Skip to content

Instantly share code, notes, and snippets.

@float64co
float64co / vertex.js
Last active March 1, 2026 19:51
Superlight SPA framework
/**
* vertex.js — single-file library combining:
*
* 1. VQuery — DOM layer (hn.js-inspired, jQuery surface-compatible)
* 2. Reconciler — Fiber-based React clone (pomb.us architecture + hooks)
* 3. template — Mustache template engine + component loader (Vertex.template)
* 4. Router — Backbone-style hash router (class-based + singleton)
* 5. Glue — useHash hook, unified Vertex namespace
*
* jQuery compatibility: if jQuery / $ already exist on the page they are
/* lstm.c
*
* Character‑level LSTM with BPTT.
*
* Features
* • No back‑space / in‑place updates – every status line is printed on a new line.
* • At the start of training it prints:
* Loading <file>. Training for <num_epochs> epochs.
* • Every 100 epochs the loss value is printed, followed by a 128‑character
* generated sample on the next line.
import os
import hashlib
import sys
def get_sha1(file_path):
"""Calculate the SHA1 hash of a file in chunks to handle large files."""
sha1 = hashlib.sha1()
try:
with open(file_path, 'rb') as f:
# Read in 64KB chunks for efficiency
// SPDX-License-Identifier: MIT-Modern-Variant
/*
* fugue.c — Unified Security Runtime for Security-Sensitive Kernel Modules
*
* Condenses ten protective subsystems into one coherent LKM:
*
* A. Load-Gate: Ed25519 signature verification on every .ko before init runs
* B. Build Provenance: Signed ELF note carries compiler/header/git hash; reject
* modules built outside an approved environment
* C. Symbol Firewall: Per-module declared symbol manifest enforced via kprobes;
@float64co
float64co / neonward.py
Created August 11, 2026 08:55
Nethack-inspired pure-python RPG.
#!/usr/bin/env python3
"""
NEON WARD - A cyberpunk-themed ncurses RPG.
You are a freelance operative in the rain-soaked megacity of Neo-Kowloon.
Roam the streets, loot weapons off fallen enemies and vending kiosks, and
decide the fate of every hostile you encounter: gun them down for good,
or take them down non-lethally and place them under arrest for a bounty.
Controls: