Skip to content

Instantly share code, notes, and snippets.

View undefined06855's full-sized avatar
🐴
what can you even fit in 80 characters worth of text

undefined06855

🐴
what can you even fit in 80 characters worth of text
View GitHub Profile
@dankmeme01
dankmeme01 / geode-android-hwasan.md
Last active May 26, 2026 19:57
Easy debugging of Geode mods with HWASan

Easy debugging of Geode mods with HWASan

ASan (and it's younger brother, HWASan) are incredible tools for debugging memory integrity bugs in native applications. This guide explains how to set up HWASan for Geode mods on Android and how to analyze crashes.

Requirements:

  • Device running Android 14+, lower is possible but only with ASan, which has a slightly different way of setting up. See here
  • Android Studio or any other way of building the launcher

Build the mod

@lipx1508
lipx1508 / defer.c
Created September 19, 2025 13:46
Go-like defer implementation in C
#include <stdio.h>
#include <stddef.h>
#include <stdint.h>
#define REPEAT_1(__fn) __fn(1)
#define REPEAT_2(__fn) REPEAT_1(__fn) __fn(2)
#define REPEAT_3(__fn) REPEAT_2(__fn) __fn(3)
#define REPEAT_4(__fn) REPEAT_3(__fn) __fn(4)
#define REPEAT_5(__fn) REPEAT_4(__fn) __fn(5)
#define REPEAT_6(__fn) REPEAT_5(__fn) __fn(6)
@SMJSProductions
SMJSProductions / UUIDv7.ts
Last active September 14, 2025 17:46
TypeScript UUIDv7 Implement based on the rfc9562 standard
interface OverlapConfig {
bits: number;
overlap: number;
}
interface WriteConfig {
length: number;
value: bigint;
}
@JavaScript-Packer
JavaScript-Packer / lzw.jz
Created January 9, 2016 23:28
JavaScript LZW Compression (encode and decode functions). Lempel–Ziv–Welch (LZW) is a universal lossless data compression algorithm created by Abraham Lempel, Jacob Ziv, and Terry Welch. It was published by Welch in 1984 as an improved implementation of the LZ78 algorithm published by Lempel and Ziv in 1978. The algorithm is simple to implement,…
function en(c) {
var x = "charCodeAt", b, e = {}, f = c.split(""), d = [], a = f[0], g = 256;
for (b = 1; b < f.length; b++) c = f[b], null != e[a + c] ? a += c :(d.push(1 < a.length ? e[a] :a[x](0)),
e[a + c] = g, g++, a = c);
d.push(1 < a.length ? e[a] :a[x](0));
for (b = 0; b < d.length; b++) d[b] = String.fromCharCode(d[b]);
return d.join("");
}
function de(b) {
@yiwenl
yiwenl / GLSL_contrast
Last active March 14, 2026 18:16
Greyscale in glsl
float contrast(float mValue, float mScale, float mMidPoint) {
return clamp( (mValue - mMidPoint) * mScale + mMidPoint, 0.0, 1.0);
}
float contrast(float mValue, float mScale) {
return contrast(mValue, mScale, .5);
}
vec3 contrast(vec3 mValue, float mScale, float mMidPoint) {
return vec3( contrast(mValue.r, mScale, mMidPoint), contrast(mValue.g, mScale, mMidPoint), contrast(mValue.b, mScale, mMidPoint) );