Skip to content

Instantly share code, notes, and snippets.

@sambacha
sambacha / Claude_Code_Perses
Created July 20, 2025 11:52 — forked from xtang/Claude_Code_Perses
Perses config for monitoring Claude Code
{
"kind": "Dashboard",
"metadata": {
"name": "claude-code-personal",
"project": "default",
"version": 1
},
"spec": {
"display": {
"name": "Claude Code Personal Usage Dashboard"
@sambacha
sambacha / USAGE
Created July 16, 2025 07:04
Take Git Patch, and extrapolate its contents (reproduce file contents and structure)
usage: extract_patch.py [-h] [-o OUTPUT] [--list] [--github] [--repo REPO] [--commit COMMIT] [--branch BRANCH] [--force-branch] patch_file
Extract files from git patch
positional arguments:
patch_file Path to the git patch file
options:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
@sambacha
sambacha / claude-code-prompts.js
Created July 6, 2025 04:41 — forked from transitive-bullshit/claude-code-prompts.js
Unminified prompts and tool definitions for Claude Code
// Claude Code is a Beta product per Anthropic's Commercial Terms of Service.
// By using Claude Code, you agree that all code acceptance or rejection decisions you make,
// and the associated conversations in context, constitute Feedback under Anthropic's Commercial Terms,
// and may be used to improve Anthropic's products, including training models.
// You are responsible for reviewing any code suggestions before use.
// (c) Anthropic PBC. All rights reserved. Use is subject to Anthropic's Commercial Terms of Service (https://www.anthropic.com/legal/commercial-terms).
// Version: 0.2.9
@sambacha
sambacha / solidity.kak
Created June 18, 2025 01:19
solidity kakoune
# Kakoune configuration for Solidity
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
# Detection
# ‾‾‾‾‾‾‾‾‾‾
hook global BufCreate .*\.sol %{
set-option buffer filetype solidity
}
@sambacha
sambacha / fnparse-gas-snapshot.mjs
Created June 17, 2025 23:26
foundry gas snapshot parsing
#!/usr/bin/env node
// SPDX-License-Identifier: 0BSD
// BSD Zero Clause License
// @model: claude-sonnet-4-20250514
/**
* @fileoverview Foundry Gas Snapshot Parser
* @description Parses Foundry .gas-snapshot files into CSV format with detailed statistics
* @module gas-snapshot-parser
@sambacha
sambacha / web_authn_pem_to_keystore.sh
Created May 31, 2025 17:21
web authn private key to keystore format
#!usr/bin/env bash
# !ACHTUNG: Use at your own risk, AI slop generated
# You can export web authn private key using devtools web authn thingy
# Play stupid games, win retarded prizes
# Avoid contact with eyes, apply directly to forehead
#
PEM_FILE="private_key.pem"
KEYSTORE_NAME="my_eth_wallet"
#!/bin/sh
n=$1
shift
for i in $(seq $n); do
"$@" || exit 1
done
@sambacha
sambacha / 60000000.json
Created May 29, 2025 22:00
60000000 gas
{
"fee_recipient": "0x4675C7e5BaAFBFFbca748158bEcBA61ef3b0a263",
"gas_limit": "60000000",
"timestamp": "1747259492",
"pubkey": "0x8cc78da09b1dc434f0609b05461eb9031cd3f38dd30dd65fbf036a593922cadaba9dfd8a94e0c29b33cc65a70b605e52"
}
def is_one_confirmed(store, block_root) -> bool:
"""
Same logic as in the Confirmation Rule PR
"""
pass
def get_checkpoint_weight(store, checkpoint, checkpoint_state) -> Gwei:
"""
Uses LMD-GHOST votes to estimate FFG support for a checkpoint.
/* @source {@link https://piccalil.li/blog/a-more-modern-css-reset/}
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Prevent font size inflation */
html {