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 / 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
@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 / 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 / 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 / README.md
Last active May 6, 2024 12:31
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 / 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 / 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;