Skip to content

Instantly share code, notes, and snippets.

View pegvin's full-sized avatar
🚩
Busy Spreading Anti-Rust Propganda

Адитя pegvin

🚩
Busy Spreading Anti-Rust Propganda
View GitHub Profile
@pegvin
pegvin / Python-Notes.md
Last active March 21, 2025 22:34
Python Notes

Print Function

The print function takes unlimited amount of inputs & Shows them on screen. So the output of print("Hello", "World") will be Hello World.

By default inputs are separated by space, But we can change that by specifying the separator at the end of the print function like so: print("Hello", "World", sep = "$", And it will result in Hello$World

By default when print function finishes it outputs a new line, We can change that by specifying the ending character like so: print("Hello", "World", end = "$"), And it will result in Hello World$

Find the output:

  1. print("Hello World", sep = "$")
@pegvin
pegvin / dynarr.c
Created April 7, 2024 17:10
Dynamic Array in C
#include "dynarr.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
bool DynArr_Init(DynArr *arr, uint8_t itemSize, uint32_t capacity) {
arr->data = malloc(capacity * itemSize);
if (arr->data == NULL) return false;
@pegvin
pegvin / Default.sublime-keymap
Created March 7, 2024 13:22
Sublime Text 4 Config
[
{ "keys": ["ctrl+`"], "command": "toggle_terminus_panel", "args": {"hide_active": true} },
{ "keys": ["ctrl+tab"], "command": "next_view" },
]
@pegvin
pegvin / README.md
Last active February 9, 2025 09:18
FastFox - my firefox user.js & visual config

How to install

  • copy the user.js to any of the corresponding path for your OS listed below.
  • copy the userChrome.css & userContent.css into the chrome folder (create one if doesn't exist) in any of the corresponding path for your OS listed below.
OS Path
Windows %APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.your_profile_name\
Windows (portable) [firefox directory]\Data\profile\
Linux ~/.mozilla/firefox/XXXXXXXX.your_profile_name/
@pegvin
pegvin / How-To-Use-ZLib.md
Last active February 5, 2023 15:49
How To Use ZLib For Compressing & De-Compressing Data

How To Use ZLib For Compressing & De-Compressing Data

this simple gist gives you a gist of how to use zlib, the code was originally from https://bobobobo.wordpress.com/ but i had to convert it to be compile-able on almost every machine including windows.

  • Compile: gcc -o zlib-howto main.c --std=c99 -lz
  • Run: ./zlib-howto or zlib-howto.exe (on windows)

make sure you have zlib installed.

  • Arch & Derivatives: pacman -S zlib
  • Debian & Derivatives: sudo apt-get install zlib1g zlib1g-dev
@pegvin
pegvin / main.c
Last active February 2, 2023 19:56
Simple Macro Based Function Profiler in C
#include "simple_profiler.h"
#ifdef LINUX
#include <unistd.h>
#endif
#ifdef WINDOWS
#include <windows.h>
#endif
void _sleepms(int ms) {
@pegvin
pegvin / main.c
Created January 23, 2023 13:24
Simple Function To Get A Single Digit From A Number At A Index
#include <stdlib.h>
#include <stdio.h>
int GetDigitAtIndex(int index, int num) {
int dig = 0, i = 0;
while(num > 0) {
dig = num % 10;
num = num / 10;
if (i == index) return dig;
i++;
@pegvin
pegvin / FreeSoundOrgDownloader.js
Last active October 14, 2022 08:38
Download Sounds From Freesound.org Without Login
// ==UserScript==
// @name Freesound.org download without login (direct link, no login)
// @namespace https://greasyfork.org/users/200700
// @version 1.0.0
// @description Download from freesound.org without login; freesound no login
// @author SuperOP535
// @match *://freesound.org/people/*/sounds/*
// @grant none
// @run_at document-load
// @source https://greasyfork.org/en/scripts/380743-freesound-org-download-without-login-direct-link-no-login