Skip to content

Instantly share code, notes, and snippets.

@meteozond
meteozond / claude-subagent-cache-proxy.py
Created July 29, 2026 05:11
claude-subagent-cache-proxy.py
#!/usr/bin/env python3
"""
Transparent Anthropic API proxy that fixes prompt-cache breakpoint placement
for our stage-1/stage-2 labeling subagents.
Problem: Claude Code sends STAGE1 (the big taxonomy prompt) and the per-item
request as ONE text block in the user message, and auto-caches the whole block.
Since the item varies per subagent, the cached unit is uniqueeach subagent
WRITES the 37k STAGE1 instead of READING a shared copy.
@meteozond
meteozond / inadyn.sh
Last active August 16, 2024 02:56
Simple OpenWrt startup Inadyn init.d script /etc/init.d/inadyn
#!/bin/sh /etc/rc.common
# chmod +x /etc/init.d/inadyn
# /etc/init.d/inadyn enable
# /etc/init.d/inadyn start
START=50
STOP=50
USE_PROCD=1
[
{
"name": "sp84.left"
},
[
{
"x": 2.5,
"a": 6
},
"Esc",
interface BaseCreateWidgetParam {
show_level: hmUI.show_level
}
interface ImageParam extends BaseCreateWidgetParam{
/**
* The path of the image. Reference folder-structure structure.
*/
src: string
/**
@meteozond
meteozond / TemplateAtLayerChange.py
Last active February 18, 2022 17:56
Ulimaker Cura g-code template insertion PostPocessing script
# Copyright (c) 2022 Meteozond
# The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
import json
import traceback
from ..Script import Script
class TemplateAtLayerChange(Script):
@meteozond
meteozond / tor_transmission.sh
Last active February 16, 2022 20:03
Start Tramsission.app with Tor Bowser proxy on macos
open \
--env ALL_PROXY="socks5://127.0.0.1:9150" \
/Applications/Transmission.app
@meteozond
meteozond / right.layout.kbd.json
Last active December 19, 2023 07:42
Right layout of YMDK 75% SP84 (aka wheatfield/split75 and mt/split75) http://www.keyboard-layout-editor.com/#/gists/33730a57e0b35df9d58da662283ce3a9
[
[
{
"x": 0.5
},
"F7",
"F8",
"F9",
"F10",
"F11",
@meteozond
meteozond / sp84_left.kbd.json
Last active February 5, 2024 08:05
Left layout of YMDK 75% SP84 (aka wheatfield/split75 and mt/split75) http://www.keyboard-layout-editor.com/#/gists/c32946fa4b6e3d9fec0e4d1c67cbd649
[
{
"name": "sp84.left"
},
[
{
"x": 2.25,
"a": 6
},
"Esc",
@meteozond
meteozond / jupyter_sequence_diagram.py
Last active March 26, 2021 10:54
Jupyter generated sequence diagram
from IPython.core.display import display, HTML
from random import randint
def sequence_diagram(diagram):
d = randint(0,1000)
display(HTML(f'''
<script src="https://bramp.github.io/js-sequence-diagrams/js/webfont.js"></script>
<script src="https://bramp.github.io/js-sequence-diagrams/js/snap.svg-min.js"></script>
<script src="https://bramp.github.io/js-sequence-diagrams/js/underscore-min.js"></script>
<script src="https://bramp.github.io/js-sequence-diagrams/js/sequence-diagram-min.js"></script>
<div id="diagram{d}"></div>
@meteozond
meteozond / hombridge-plug.sh
Created September 13, 2020 07:26
HomeBridge bash curl plug controlling
# on
curl -X PUT
--data '{"characteristics":[{"aid": 6, "iid":10, "value": 1}]}' \
--header "authorization:031-45-154" \
--header "Content-Type:Application/json" \
http://localhost:53102/characteristics
# off
curl -X PUT
--data '{"characteristics":[{"aid": 6, "iid": 10, "value": 0}]}' \