Skip to content

Instantly share code, notes, and snippets.

@etscrivner
etscrivner / oh4_halftone.h
Created April 2, 2026 17:43
Single-header C library for converting continuous-tone images down to 1-bit via grayscale conversion, tonal adjustment, sharpening, edge detection, and dithering. Largely targeted at the Playdate.
/*
oh4_halftone.h - v1.1 - public domain
Authored 2026 by Eric Scrivner
no warranty implied; use at your own risk
Before including,
#define OH4_HALFTONE_IMPLEMENTATION
in the file that you want to have the implementation.
@a-c-m
a-c-m / reflection.md
Last active May 4, 2026 11:13
reflection.md - a way to have claude-code self improve its context.

You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code. Follow these steps carefully:

  1. Analysis Phase: Review the chat history in your context window.

Then, examine the current Claude instructions, commands and config <claude_instructions> /CLAUDE.md /.claude/commands/*

@DraperDanMan
DraperDanMan / crank_indicator.c
Created November 20, 2024 20:39
Playdate CrankIndicator C port
#include "crank_indicator.h"
int clockwise = 1;
int crankIndicatorY = 210;
int textOffset = 76;
unsigned currentScale = 1;
int currentFrame = 1;
int frameCount = 0;
int textFrameCount = 14;
@dndrks
dndrks / w-i2c-rec-seq.lua
Last active January 27, 2026 04:53
W/Tape: i2c recording sequencer
-- W/Tape: i2c recording sequencer
-- as shown in https://youtu.be/2RUHr-iX1VE?si=Ny_3t0TNqKlAaWoQ&t=1216
-- requires crow
-- patch crow output 1 to an oscillator's v/8
-- patch crow output 2 to an envelope generator
-- execute 'auto_rec()' to start recording loops at different speeds
-- execute 'auto_play()' to play through each of the loops
@dndrks
dndrks / w-clocked-looping.lua
Last active January 27, 2026 04:53
W/Tape: clocked looping
-- W/Tape: clocked looping
-- as shown in https://youtu.be/2RUHr-iX1VE?si=Ibf7IRycZX5VoLng&t=667
-- requires crow
-- patch crow output 1 to an oscillator's v/8
-- patch crow output 2 to an envelope generator
-- set THIS & THAT to 'loop'
-- tap 'play' to get things rolling
-- tap 'record' to arm recording
@Enitoni
Enitoni / README.md
Created July 6, 2023 16:38
Guide on how to properly delete your reddit account.

How to properly delete your Reddit account

After countless protests from the community and greed (not to mention arrogance) from the CEO of Reddit, enough is enough! It's time to leave this website, and show them no mercy.

This guide is for those of you who are finally fed up with the company having no regard for their users, and who are now ready to leave.

Prerequisites

  • A desktop browser
  • A little tech-savvyness, or at least being comfortable using the developer tools in your browser
  • Patience
@aschuhardt
aschuhardt / pattern.h
Last active April 15, 2026 17:01
Playdate pattern definitions in a single-header C library
/*
* This is a collection of Playdate patterns compiled into a header-only library
* for use in C SDK projects.
*
* The pattern definitions listed here are copied directly from Ivan Sergeev's
* 'gfxp' library, which can be found here: https://github.com/ivansergeev/gfxp
*
*
* USAGE:
*
@jaames
jaames / playdate-curve.lua
Last active April 15, 2026 17:52
Simple bezier curve drawing functions for the Playdate Lua SDK
-- bezier curve drawing functions for playdate lua
-- these are based on de Casteljau's algorithm
-- this site has a nice interactive demo to compare both types of curve: https://pomax.github.io/bezierinfo/#flattening
-- draws a curve starting at x1,y1, ending at x3,y3, with x2,y2 being a control point that "pulls" the curve towards it
-- steps is the number of line segments to use, lower is better for performance, higher makes your curve look smoother
-- the playdate is kinda slow, so it's recommended to find a relatively low step number that looks passable enough!
function drawQuadraticBezier(x1, y1, x2, y2, x3, y3, steps)
steps = steps or 8
local d = 1 / steps
@tothi
tothi / nmap-http-url.py
Last active January 6, 2026 15:04
Generate HTTP URLs from Nmap XML (and optionally use VirtualHosts)
#!/usr/bin/env python3
#
# inputs: nmap.xml (nmap scan xml output), subdomains.csv (optional virtualhost info, hostname + ip address csv file)
# output: url listing (useful for tools like EyeWitness)
#
# sample usage: ./nmap-http-url.py nmap.xml subdomains.csv | sort -u | gowitness file -f -
#
description = '''
Generate HTTP URLs from Nmap XML (and optionally additional VirtualHost listing, taken from e.g. subdomain enumeration).
@jaames
jaames / playdate_adpcm.c
Last active April 15, 2026 17:01
Example for decoding and playing an ADPCM audio buffer on the Playdate in C, only supports mono IMA-ADPCM with no blocks!
// adpcm.h
#define CLAMP(n, l, h) \
if (n < l) n = l; \
if (n > h) n = h;
#define min(a,b) (((a) < (b)) ? (a) : (b))
static const int8_t indexTable[8] =
{ -1, -1, -1, -1, 2, 4, 6, 8 };