Skip to content

Instantly share code, notes, and snippets.

View thedavidmeister's full-sized avatar

David Meister thedavidmeister

View GitHub Profile
@thedavidmeister
thedavidmeister / testPushAndRetrieveStackNameDoubleIdentical.json
Created September 7, 2026 12:18
rainlang LibParseStackName fuzz counterexamples (foundry cache/fuzz/failures entries)
{"warp":null,"roll":null,"sender":null,"addr":null,"calldata":"0x547446ed0000000000000000000000000000000000000000000000000000000000000040d2f67e6aeaad1ab7487a680eb9d3363a597afa7a3de33fa9bf3ae6edcb88435d000000000000000000000000000000000000000000000000000000000000050a00000000000000000000000000000000000000000000000000000000000000ac000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000001e4800000000000000000000000000000000000000000000000000000000000004e86e6f770000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000000000000000003696e6465782073686f756c642062652030206f6e206d69737300000000000000daa0024dc105c6a9ea0838604bad0a5e662743eca97789c2cecfdf8667d0bf9b696e74323536293a204d6178206973206c657373207468616e206d696e2dffff207265616368657320616e20756e6465636c61726564207369626c6
@thedavidmeister
thedavidmeister / README.md
Created August 16, 2026 07:19
Context caps for Claude Code: a PostToolUse hook that caps the auto-memory index, the guide it points at instead of printing, and notes on the failure modes

A context cap as a Claude Code hook

MEMORY.md loads into context at the start of every session, so its size is a recurring cost paid on every turn of every conversation in that scope. Claude Code's own limit (200 lines / 25KB) is a truncation point, not a budget: content past it is silently dropped on the next load. This hook enforces a real budget well below that, so the index stays an index.

Both files below are in production use, not written for this gist.

example https://raw.githubusercontent.com/Beltan/rain/refs/heads/main/swap_sflr_cysflr
# Strat: Recharging tranches
#
# High level idea is that the strategy offers a firm price for batches of tokens.
# Each batch is called a "tranche".
#
# Every time a batch of tokens fully clears a new price further from the previous
# trades is offered for the next tranche.
#
# For example, if 1000 BLUE was available in a tranche to buy RED at
# 1 BLUE per RED and this fully cleared, the next tranche might be to buy up to
/* op meta ref 613769424da0faccd68bfa8d9b3af911a278c706 */
@0x47ed85f917e187757bff09371cedcf5c0eb277c27e4673feb2d3cc040c66c993
/* ob meta ref 613769424da0faccd68bfa8d9b3af911a278c706 */
@0x56ffc3fc82109c33f1e1544157a70144fc15e7c6e9ae9c65a636fd165b1bc51c
#one 1e18
#target-threshold 1e14
#start-time 1683480203
@thedavidmeister
thedavidmeister / default.nix
Last active November 11, 2019 13:47
nixos-holochain-binary-name-fns
rec {
normalize-artifact-target = target:
builtins.replaceStrings
[ "unknown" ]
[ "generic" ]
target
;
artifact-name = args: "${args.name}-${args.version}-${normalize-artifact-target args.target}";
artifact-url = args: "https://github.com/${args.owner}/${args.repo}/releases/download/${args.version}/${artifact-name args}.tar.gz";
@thedavidmeister
thedavidmeister / Vagrantfile
Created August 18, 2019 11:28
minimal holonix vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "holochain-vagrant"
config.vm.box_url = "https://holochain.love/box"
config.vm.provider "virtualbox" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "4096"
vb.cpus = "4"
vb.customize ["modifyvm", :id, "--hwvirtex", "off"]
end
let
holonix = import (fetchTarball {
url = "https://github.com/holochain/holonix/tarball/master";
});
# holonix = import ../holonix;
in
with holonix.pkgs;
{
core-shell = stdenv.mkDerivation (holonix.shell // {
name = "app-shell";
@thedavidmeister
thedavidmeister / Vagrantfile
Created June 26, 2019 15:51
Vagrantfile used in the Holochain quick start guide https://developer.holochain.org/start.html
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at

Keybase proof

I hereby claim:

  • I am thedavidmeister on github.
  • I am thedavidmeister (https://keybase.io/thedavidmeister) on keybase.
  • I have a public key ASBKQkYiiUzEGTaJXeprS2wAf0fwr0lZRIyebqvmEAtepAo

To claim this, I am signing this object: