Skip to content

Instantly share code, notes, and snippets.

View DavideGalilei's full-sized avatar
🐝

Davide Galilei DavideGalilei

🐝
View GitHub Profile
@benhoyt
benhoyt / markov.py
Created November 11, 2023 15:45
Generate text from an input using a simple Markov chain generator
import collections, random, sys, textwrap
# Build possibles table indexed by pair of prefix words (w1, w2)
w1 = w2 = ''
possibles = collections.defaultdict(list)
for line in sys.stdin:
for word in line.split():
possibles[w1, w2].append(word)
w1, w2 = w2, word
@a1k0n
a1k0n / donut.c
Created October 23, 2023 04:03
donut shift and add only
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#define debug(...)
//#define debug printf
// torus radii and distance from camera
@LiquidityC
LiquidityC / Makefile
Last active December 1, 2023 03:24
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@ShiSHcat
ShiSHcat / how.md
Created June 1, 2022 19:24
Convert all CGBI pngs in a folder to standard PNGs

save this script as script.js

  1. install node.js
  2. npm i cgbi-to-png
  3. put your files in cgbi_in
  4. run script.js
  5. check your files in cgbi_out
@aydynx
aydynx / discord.md
Last active May 2, 2024 14:48
discord stuff

tokens

all scripts written by me
they should continue working until the next webpack update

obtaining your token

v1:

webpackChunkdiscord_app.push([[0],,e=>Object.keys(e.c).find(d=>(t=e(d)?.default?.getToken?.())&&console.log(t))])

v2:

@Justasic
Justasic / TLCRC.py
Created March 24, 2022 22:27
Calculate the CRC32 values of Telegram's Type Language constructor IDs
#!/usr/bin/env python3
import sys, re
from zlib import crc32
from typing import Tuple
from PyQt5.QtWidgets import QWidget, QLineEdit, QApplication, QLabel, QVBoxLayout, QHBoxLayout
class Calculator(QWidget):
def __init__(self):
super().__init__()
@tucnak
tucnak / StopWordle.user.js
Last active February 24, 2022 11:38
Hide all mentions of Wordle from Hacker News feeds
// ==UserScript==
// @name Stop Wordle!
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Hide all mentions of Wordle from Hacker News feeds!
// @author https://github.com/tucnak
// @match https://news.ycombinator.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com
// @grant none
// ==/UserScript==
@rexim
rexim / main.rs
Last active April 3, 2024 19:40
The Most Memory Safe Buffer Overflow in Rust!
// The Most Memory Safe Buffer Overflow in Rust!
//
// Consider all the code below under Public Domain
//
// How to build:
// $ rustc main.rs
//
// Wrong password:
// $ printf "hello\n" | ./main
//
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
// Bad example
interface IRemoteData<T> {
result?: T
error?: string
isLoading: boolean
isLoaded: boolean
}
// Same on OOP