Skip to content

Instantly share code, notes, and snippets.

View lloyd's full-sized avatar

Lloyd Hilaiel lloyd

View GitHub Profile
@lloyd
lloyd / worktree.sh
Created March 27, 2026 20:36
Shell helpers for managing git worktrees + Claude Code sessions
# Worktree + Claude management
# Depends on: kraysee (from kraysee.sh)
# ── helpers ───────────────────────────────────────────────────────
# Detect the default branch for a repo (develop > main > master)
_wt_default_branch() {
local root="${1:-.}"
local branch
branch=$(git -C "$root" symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||')
@lloyd
lloyd / tetris.gg.tar.b64
Created March 17, 2026 22:42
Tetris GarGamel bundle
ZW52Lmx1YQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAxMDA2NDQAMDAwMDc2NQAwMDAwMDI0ADAwMDAwMDI1MDA0ADE1MTU2MTUwNDQyADAwMTA1MzQAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB1c3RhciAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwADAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtLSBUZXRyaXMg4oCUIEVudmlyb25tZW50IHBoYXNlCi0tIE5FUyBUZXRyaXMgKDE5ODkpIGZhaXRoZnVsIG1lY2hhbmljczogTlJTIHJvdGF0aW9uLCBubyB3YWxsIGtpY2tzLAotLSBpbnN0YW50IGxvY2ssIERBUyAxNi82IGZyYW1lcywgcmUtcm9sbCByYW5kb21pemVyLCBubyBoYXJkIGRyb3AKCmxvY2FsIENPTFMsIFJPV1MgPSAxMCwgMjAKCi0tIE5SUyBwaWVjZSBkZWZpbml0aW9uczogZWFjaCBoYXMgY29sb3Ige3IsZyxifSBhbmQgcm90YXRp
var http = require('http'),
toobusy = require('toobusy');
console.log("Maximum allowed event loop lag: " + toobusy.maxLag(50) + "ms");
function processRequest(res, num, startTime) {
if (!startTime) startTime = new Date();
if (num === undefined) {
return process.nextTick(function() {
@lloyd
lloyd / update_gh-pages.sh
Created May 19, 2011 17:12
A lil script to create a gh-pages branch from a subset of the repository. EXPENSIVE
$ git branch -D gh-pages
$ git branch gh-pages
$ git filter-branch --subdirectory-filter test/ gh-pages
$ git push -f origin gh-pages:gh-pages
1. put <file> on sdcard
2. put sdcard in device
3. reboot and hold down up arrow and power for 10s.
4. "apply update from external storage" - select <file>
5. "wipe data/factory reset"
6. reboot
Now you've got an unrooted phone. Let's install a su binary that gives us root.
1. download root-zte-open.zip (md5 cecc15bd0cc315633d066d81b44d7732)
@lloyd
lloyd / mapvslice_test.go
Created July 19, 2017 09:03
maps vs slices for mapping small sets of ordinals to values
package whatever
import (
"testing"
)
func BenchmarkMapConstruction(b *testing.B) {
space := make([]map[int][]string, b.N)
for n := 0; n < b.N; n++ {
space[n] = map[int][]string{
[lth@lappro ~] $ mkdir test
[lth@lappro ~] $ cd test/
[lth@lappro test] $ git init
Initialized empty Git repository in /Users/lth/test/.git/
[lth@lappro test] $ mkdir foo
[lth@lappro test] $ mkdir foo/bar
[lth@lappro test] $ touch foo/bar/baz
[lth@lappro test] $ touch foo/bar/bing
[lth@lappro test] $ touch foo/bar/boom
[lth@lappro test] $ git add foo/
--- emacs-22.1.orig/src/unexmacosx.c 2007-01-20 21:18:15.000000000 -0700
+++ emacs-22.1/src/unexmacosx.c 2007-10-31 10:32:19.000000000 -0600
@@ -448,10 +448,9 @@
case, trailing pages are initialized with zeros. */
for (p = ranges->address + ranges->size; p > ranges->address;
p -= sizeof (int))
- if (*(((int *) p)-1))
+ if (*(((char *) p)-1))
break;
Title
[Please provide a descriptive (but short) title for your session.]
Embedding Ruby for Fun and Profit
Description
[Provide a short summary description of your session topic. This will
be posted publicly if your proposal is accepted.]
Life is too short to write native code. It takes too long, it works
@lloyd
lloyd / assertion sizes.txt
Created December 20, 2013 10:44
assertion sizes
(format: idp key algorithm / user key algorithm / size in bytes)
New formats:
RS/64 RS/64 612
RS/64 RS/128 811
RS/64 RS/256 1210
RS/64 DS/128 1199
RS/64 DS/256 1937
RS/128 RS/64 698
RS/128 RS/128 897