Skip to content

Instantly share code, notes, and snippets.

// @title rubble.
// A 3KB megademo for Playload, after debris. No data, code only. Sound on! Any button pauses; it loops.
const S = Math.sin, C = Math.cos, PI = Math.PI, A = Math.abs, M = Math.min, X = Math.max;
const h = (i) => A(S(i * 12.9898) * 43758.5) % 1;
// Glyphs for drawing: dot, 2×2, 8×1 line, 4×4 cube (body, lit top, dark side), 8×8 cube (body, top, side)
['#80', '$c0c0', '%ff', '&f0f0f0f0', "'f0", '(10101010', ')ffffffffffffffff', '*ffff', '+0303030303030303']
.forEach((p) => (pcg[p[0]].pat = p.slice(1).padEnd(16, 0)));
// ---------- Music: A minor, Am F Dm E ----------
@andrisgauracs
andrisgauracs / run_prompt.sh
Created July 31, 2026 02:57
Test a custom prompt against an already-trained, already-flashed ESP32-S3 model
#!/usr/bin/env bash
# esp32-ai: test a custom prompt against an already-trained, already-flashed model.
# Does NOT retrain and does NOT rewrite the 15MB model partition.
#
# Usage:
# ./run_custom_prompt.sh "Once there was a robot"
set -euo pipefail
if [ "$#" -lt 1 ]; then
echo "Usage: $0 \"Your custom prompt\""
@andrisgauracs
andrisgauracs / build_and_flash.sh
Created July 31, 2026 02:21
One Shot Build Script For Running 28M AI Model On ESP32-S3
#!/usr/bin/env bash
# esp32-ai: clone, train, export, build, and flash — end to end
# Reproduces github.com/slvDev/esp32-ai from a bare board.
# Requires: ESP32-S3 N16R8 (16MB flash, 8MB PSRAM).
#
# Usage:
# ./build_and_flash.sh # full run: data prep, train, export, build, flash
# ./build_and_flash.sh --skip-train # reuse an existing firmware/model/model.bin, just build + flash
set -euo pipefail
// $ cc -o checker checker.c
// $ ./checker
// $ ffmpeg -i output-%02d.ppm -r 60 output.mp4
#include <stdio.h>
int main()
{
char buf[256];
for (int i = 0; i < 60; ++i) {
snprintf(buf, sizeof(buf), "output-%02d.ppm", i);
@0riginaln0
0riginaln0 / input.zig
Created March 14, 2025 09:04
Input handling "library" in Zig for WASM-4
const w4 = @import("wasm4.zig");
pub const Input = struct {
previous_frame_gamepad: u8,
current_frame_gamepad: u8,
previous_frame_mouse: u8,
current_frame_mouse: u8,
previous_frame_mouse_x: i16,
@cheikhsimsol
cheikhsimsol / video_stream.go
Created December 30, 2024 19:37
Full video stream example
package main
import (
"fmt"
"io"
"log"
"net/http"
"strconv"
"strings"
)
@anthonycaccese
anthonycaccese / es-history.md
Last active April 8, 2026 18:47
EmulationStation History

EmulationStation is a graphical and themeable emulator front-end created by Aloshi around 2012. Their original work has been the foundation for the UX of many of our favorite gaming focused projects over the last decade and this document aims to capture a small bit of that history. If you see any errors please let me know in the comments below and I will gladly update this document.

History:

es-history

References:

// Odin + Box2D + Raylib example with stacking boxes and a shape attached to the cursor that can smack the shapes.
// Made (mostly) during this stream: https://www.youtube.com/watch?v=LYW7jdwEnaI
// I have updated this to use the `vendor:box2d` bindings instead of the ones I used on the stream.
package game
import b2 "vendor:box2d"
import rl "vendor:raylib"
@rauchg
rauchg / p.sh
Last active December 12, 2025 08:21
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@alexedwards
alexedwards / Makefile
Last active October 16, 2026 19:36
Boilerplate Makefile for Go projects
# Change these variables as necessary.
main_package_path = ./cmd/example
binary_name = example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help