Skip to content

Instantly share code, notes, and snippets.

View eisbaw's full-sized avatar
♻️
the garbage man can 🎵

Mark Ruvald Pedersen eisbaw

♻️
the garbage man can 🎵
View GitHub Profile
@eisbaw
eisbaw / claude_loop3.py
Created July 29, 2025 06:30
Run Claude Code forever in a loop
#!/usr/bin/env python3
"""
Continuously sends a prompt to the `claude` CLI, stores the streamed JSON
responses to a file, and respects any reported rate-limit reset
time by sleeping until the limit expires. The script mirrors the tool’s output
both to stdout and to the JSON log file so existing log-processing workflows
continue to work.
"""
import json
@eisbaw
eisbaw / pipes.hs
Created May 5, 2012 21:51
"Pipes" in Haskell
#!/usr/bin/env runhaskell
-- Single and double pipe operators are taken, so use triple-pipe :)
infixl 9 |||
(|||) :: a -> (a -> b) -> b
x ||| f = f x
len = fromIntegral . length
mean xs = sum xs / len xs