Skip to content

Instantly share code, notes, and snippets.

View valentecaio's full-sized avatar
🚲

Caio Valente valentecaio

🚲
View GitHub Profile
@ryankurte
ryankurte / main.c
Last active October 5, 2024 07:39
Simple C FIFO Queues (aka Ring Buffers)
#define QUEUE_SIZE 16
int main(int argc, char** argv) {
queue_t example = {0, 0, QUEUE_SIZE, malloc(sizeof(void*) * QUEUE_SIZE)};
// Write until queue is full
for (int i=0; i<QUEUE_SIZE; i++) {
int res = queue_write(&example, (void*)(i+1));
assert((i == QUEUE_SIZE - 1) ? res == -1: res == 0);
}
@phrawzty
phrawzty / 2serv.py
Last active September 3, 2024 03:33
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no