Skip to content

Instantly share code, notes, and snippets.

@7etsuo
7etsuo / main.c
Created July 18, 2025 07:23
Turing-complete Scheme interpreter in C that supports lexical scoping, closures, continuations, and proper tail-call for tail recursion without stack growth.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
typedef struct Obj *Obj;
typedef struct Kont *Kont;
enum Type { T_PAIR, T_SYMBOL, T_NUMBER, T_BOOLEAN, T_PRIMITIVE, T_CLOSURE, T_CONTINUATION };
@7etsuo
7etsuo / screen.c
Created July 5, 2025 02:20
screen.c
int g_screen_height = 400; /* height in bits */
int g_screen_width = 640; /* width in bits */
int g_screen_size = 32000; /* total bytes */
const uint32_t screen[] = {
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
@7etsuo
7etsuo / cheatsheet_x86.txt
Created June 13, 2025 18:23
cheatsheet_x86.txt
___ ___ ________ ________________ __
| \/ || ___| \/ | _ | ___ \ \ / /
| . . || |__ | . . | | | | |_/ /\ V /
| |\/| || __|| |\/| | | | | / \ /
| | | || |___| | | \ \_/ / |\ \ | |
┌\_|──|_/\____/\_|──|_/\___/\_|─\_|─\_/────────────────────────────────────────────────────
│ │ ► Function Prologue
@7etsuo
7etsuo / r0.c
Created April 22, 2025 09:39
r0
This file has been truncated, but you can view the full file.
union _LARGE_INTEGER{
DWORD LowPart;
LONG HighPart;
struct _LARGE_INTEGER__$837407842DC9087486FDFA5FEB63B74E{
DWORD LowPart;
LONG HighPart;
} u;
LONGLONG QuadPart;
}
struct _WMI_FLTIO_NOTIFY_ROUTINES{ TimeStampRoutine* TimeStampRoutine; FailureNotifyRoutine* FailureNotifyRoutine; InitiationNotifyRoutine* InitiationNotifyRoutine; CompletionNotifyRoutine* CompletionNotifyRoutine; FastCompletionNotifyRoutine* FastCompletionNotifyRoutine; IoRedirectionNotifyRoutine* IoRedirectionNotifyRoutine; }
@7etsuo
7etsuo / description.md
Created April 17, 2025 21:58
database schema

Meme Database Schema

1. Users Table

Table Name: users
Primary Key: id
Description: This table stores user information, including their username, email, avatar URL, and various metrics related to their meme activity.
Relationships:

  • One-to-Many with Memes: Each user can create multiple memes. This is represented by the user_id foreign key in the memes table.

2. Memes Table

@7etsuo
7etsuo / tetsol.md
Created April 6, 2025 01:23
tetsol.md

Development Roadmap for a Cross-Platform Solana AR Treasure Hunt Game

Phase 1: MVP – Core AR Treasure Hunt with Wallet & NFT Rewards

Core Goals: Build a minimal viable product where users can log in with a Solana wallet, navigate to real-world locations, view "treasure" in AR, and receive an NFT reward for discovery. This phase focuses on core functionality and cross-platform deployment (iOS & Android) with minimal custom infrastructure.

  • Mobile App & AR: Use Unity with AR Foundation to develop the app once and deploy on both iOS (ARKit) and Android (ARCore). Unity's AR Foundation provides a cross-platform AR framework so the same C# code works for both ARKit and ARCore. This greatly simplifies development and ensures feature parity. Leverage device GPS/location services in Unity to tie AR content to real-world locations (e.g. spawn a treasure chest when the user is within a certain radius). Optionally, integrate ARCore Geospatial API (via AR Foundation's ARCore Extensions) to
@7etsuo
7etsuo / simd.c
Created March 26, 2025 02:40
simd.c
#include <stdio.h>
#include <stdlib.h>
#include <emmintrin.h>
#if defined(__SSE3__)
#include <pmmintrin.h> // SSE3 intrinsics for _mm_hadd_pd
#endif
#include <math.h>
// Horizontal sum for a __m128d vector.
// If SSE3 is available, use _mm_hadd_pd; otherwise, use a shuffle-and-add
/** x.com/7etsuo
*
* compile with gcc -o pre_process hotdog_preprocessor.c -lgd -lm
* usage: ./pre_process dataset/train/hotdog/ dataset/train/nothotdog/
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libxml/HTMLparser.h>
#include <libxml/xpath.h>
#include <libxml/uri.h>
// Initial hash table size (prime number for better distribution)
#define INITIAL_HASH_SIZE 101
#define MAX_LOAD_FACTOR 0.75
@7etsuo
7etsuo / fred.c
Created March 9, 2025 04:57
fred.c
/** Uncle Fred
* Create an index.html and put in the same dir.
* Compile normally with cc -O2 -o http http.c, run sudo ./http 80, open your brosert and type: http://127.0.0.1/
*/
#include/* micro HTTP server */<stdio.h>
#include/* usage: ./http [port] */<stdlib.h>
#include/* */<string.h>
#include/* the default port is 8080, files are */<unistd.h>
#include/* read from the current directory */<netdb.h>