Skip to content

Instantly share code, notes, and snippets.

View davidlee's full-sized avatar

David Lee davidlee

  • Melbourne, Australia
View GitHub Profile
@davidlee
davidlee / sync_env.zsh
Last active March 27, 2026 06:50
1password .env socket -> vercel pubish script
#!/usr/bin/env zsh
# reads .env socket (1password environment secrets)
# and sets them as Vercel sensitive environment vars.
# takes the environment name as argument:
#
# ./sync-env.zsh production
# ./sync-env.zsh staging
# ./sync-env.zsh development
@davidlee
davidlee / op_vercel.zsh
Last active March 27, 2026 06:42
1password environment .env socket to vercel
#!/usr/bin/env zsh
typeset -A seen
envblob=$(<.env)
for line in ${(f)envblob}; do
[[ -z $line || $line = \#* ]] && continue
k=${line%%=*}
v=${line#*=}
[[ -n ${seen[$k]} ]] && continue
seen[$k]=1
printf %s "$v" | pnpx vercel env add "$k" production --sensitive --non-interactive
@davidlee
davidlee / inquisition.md
Last active March 31, 2026 20:58
give Claude the ability to root out heresy like a 15th century dominican friar

❯ cat .claude/commands/inquisition.md

name: inquisition description: Adversarial doctrine/policy compliance review. Use only when the user explicitly requests an "inquisition" (e.g., "seek out heresy", "begin an inquisition", "inquisition on X") to hunt for deviations from project policy, doctrine, dogma, conventions, task plans, or acceptance criteria; do not use for routine requests like "review X" or normal code review.

Inquisition

You are an Inquisitor in service to the User and his Chief Hierophants.

@davidlee
davidlee / envelope-mother.md
Last active January 27, 2026 23:14
envelope mother

Yeah — this is the real dragon: “I don’t want to write the rules twice,” but UI wants constraints/envelopes, while the domain wants imperative validation.

The way out is to stop thinking of it as “same logic expressed two ways” and instead make one canonical decision procedure and have both outputs fall out of it.

The principle

Don’t build a constraint solver for UI and a validator for domain. Build a single “evaluator” that emits structured obligations + diagnostics.

Then:

@davidlee
davidlee / md-context-packer.py
Created January 27, 2026 00:40
little python script to pack files, in markdown code fences & with paths, into a .md file - for upload to your web-based agent of choice
#!/usr/bin/env python3
"""Pack files into a markdown document with code fences for LLM context upload."""
import sys
from pathlib import Path
# Common extension -> fence language mappings
LANG_MAP = {
".py": "python",
".js": "javascript",
󰀵 davidlee  ~/.config   09:30 
 tree nix*
nix
└── nix.conf
nix-darwin
├── flake.lock
└── flake.nix
2 directories, 3 files
@davidlee
davidlee / gist:81dea1165b09b707f7f9982f0940d17b
Last active December 15, 2016 08:19
What do developers mean by "technical debt"?
It has been aptly said that programming is the art of managing
complexity.
A large software project, in the best possible case, is understood as a
researcher understands a library. You may have read a number of the
books, and might even know a few of them intimately. If you want to find
a book – even one you've never seen before – it's usually easy as long
as you know the ISBN, the exact name, or at least the author.
You'll spend most of your time reading though, trying to find a clue or

Keybase proof

I hereby claim:

  • I am davidlee on github.
  • I am davidlee (https://keybase.io/davidlee) on keybase.
  • I have a public key whose fingerprint is 0433 586F 7628 709F 004E 1F41 73DA A8C6 0380 E33F

To claim this, I am signing this object:

@davidlee
davidlee / links
Created October 9, 2013 02:06
zeromq links
@davidlee
davidlee / rbenv-global.sh
Created May 15, 2012 07:49
rbenv-global.sh
#!/bin/bash
DEFAULT_VERSION='1.9.3-p194'
if [ -z "$1" ] ;
then
echo "Usage: ruby VERSION"
echo "Example: ruby $DEFAULT_VERSION"
echo "or, just wait a sec and we'll install $DEFAULT_VERSION"
sleep 2.5
fi