Skip to content

Instantly share code, notes, and snippets.

View MurageKibicho's full-sized avatar
🛼
Working from home

Murage Kibicho MurageKibicho

🛼
Working from home
  • Yale University
  • New Haven, Connnecticut
  • 01:47 (UTC -04:00)
View GitHub Profile
@MurageKibicho
MurageKibicho / TextureCamera1.c
Created June 30, 2025 18:30
TextureCamera.c after setting up SDL2 and Emscripten
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
@MurageKibicho
MurageKibicho / TextureCamera.C
Last active June 30, 2025 17:48
Starter code for Paraxial Ray Tracing in 2D
//Starter code for https://leetarxiv.substack.com/p/paraxial-ray-tracing-in-sdl2-emscripten
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#ifndef M_PI
@MurageKibicho
MurageKibicho / Mediant32SinCos.c
Created June 26, 2025 14:52
How I implemented Sin and Cos in Mediant 32. I recommend a precision of 10 terms in the Taylor series
//Details: https://leetarxiv.substack.com/p/mediant32-intro?r=2at73k
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
#define m32_ENABLE_ERRORS 1
#define m32_TRUE 1
#define m32_FALSE 0
#define PRINT_ERROR(msg) \
do { \
@MurageKibicho
MurageKibicho / HelloTriangle-Rotate.c
Created June 21, 2025 16:31
Rotate with WASD, move and pan with mouse OpenGL, SDL2
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
@MurageKibicho
MurageKibicho / CameraMousePan.c
Created June 21, 2025 13:24
OpenGL2, SDL2, Emscripten Get Camera Mouse Pan working
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#include <stdlib.h>
#include "cglm/cglm.h"
@MurageKibicho
MurageKibicho / MouseScrollZoom.c
Last active June 21, 2025 05:38
SDL Bare minimum to get mouse scroll zoom working with OpenGL and Emscripten
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
#include <SLD2/SDL.h>
#include <SDL2/SDL_opengles2.h>
#endif
#include <stdlib.h>
#include "cglm/cglm.h"
@MurageKibicho
MurageKibicho / HelloTriangle.c
Created June 19, 2025 09:22
Emscripten OpenGL SDL2 to Express Server
//SDL2 and OpenGLES2
//Run : emcc HelloTriangle.c -s USE_SDL=2 -s FULL_ES2=1 -s WASM=1 -o HelloTriangle.html
//Preview : emrun HelloTriangle.html
//This code is discussed here : https://ffmpeg.substack.com/p/running-sdl2-and-opengl-in-c-web
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_opengles2.h>
#else
@MurageKibicho
MurageKibicho / Functions.py
Created June 10, 2025 15:24
Dual EC Backdoor in Python
#https://leetarxiv.substack.com/p/dual-ec-backdoor-coding-guide
from fastecdsa.curve import P256
from fastecdsa.point import Point
from random import randint
class DualEC():
def __init__(self, seed, P, Q):
self.seed = seed # Initial integer state of RNG
self.P = P # First elliptic curve point (public parameter)
self.Q = Q # Second elliptic curve point (could be maliciously chosen)
@MurageKibicho
MurageKibicho / 85.c
Created June 6, 2025 14:39
85 and 86 weird. idk what the fuck
#include <openssl/sha.h>
#include <openssl/rand.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <gmp.h>
#include <assert.h>
#include <math.h>
#include "ff_asm_primes.h"
#define STB_DS_IMPLEMENTATION
#include <stdio.h>
#include <stdlib.h>
void PrintArray(int arrayLength, int *array)
{
for(int i = 0; i < arrayLength; i++)
{
printf("%3d, ", array[i]);
}
printf("\n");