Skip to content

Instantly share code, notes, and snippets.

View junkdog's full-sized avatar
🐥

Adrian Papari junkdog

🐥
  • Stockholm
View GitHub Profile
@junkdog
junkdog / work-lock-for-shared-machines.md
Created December 2, 2026 07:19
claude work lock/queue

A work lock for a shared build and benchmark machine

2026-12-01 · How we keep benchmarks honest on one workstation that several coding agents (and people) build, test, fuzz and measure on at the same time: a small job coordinator, work.zsh, built on kernel file locks, and a Claude Code integration that shows its queue and stops agents from running heavy work outside it. Everything needed to rebuild it is here, the full scripts included (appendix).

We built it for the development of ada, a terminal markdown viewer and pager whose speed is benchmarked against other viewers, by coding agents that build, fuzz and measure on one shared machine. Nothing in the design is specific to ada, but the figures under "In practice" come from that project.

@junkdog
junkdog / .tmux.conf
Created March 17, 2026 19:26
tmux conf
# Unbind default prefix and set Ctrl-a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# General
set -g mouse on
set -g history-limit 50000
set -g base-index 1
set -g pane-base-index 1
@junkdog
junkdog / worm_buffer.rs
Created September 11, 2025 18:06
Caches and replays ratatui buffer changes for optimized rendering
use std::cell::RefCell;
use std::hash::{BuildHasher, Hash, Hasher};
use foldhash::fast::RandomState;
use ratatui::buffer::{Buffer, Cell};
use ratatui::layout::{Position, Rect};
/// Caches and replays ratatui buffer changes for optimized rendering
///
/// WormBuffer records only the cells that change during widget rendering, allowing
/// expensive layouts to be computed once and then replayed efficiently. On first
@junkdog
junkdog / ffmpeg-record-window.zsh
Last active December 1, 2024 10:48
ffmpeg qol
#!/usr/bin/env zsh
#
# Screen Recording Script
# ----------------------
#
# Records a selected window on your X11 display using FFmpeg. The script prompts
# you to click on a window, then automatically starts recording it to ${PWD}/output.mp4.
#
# Prerequisites:
@junkdog
junkdog / AxonDynamoTemplate.kt
Created March 27, 2023 18:58
axon dynamodb sift template
package sift.template.sandbox
import com.github.ajalt.mordant.rendering.TextStyles.bold
import com.github.ajalt.mordant.rendering.TextStyles.inverse
import sift.core.dsl.Classes
import sift.core.dsl.type
import sift.core.dsl.template
import sift.core.entity.Entity
import sift.core.graphviz.Dot
import sift.core.graphviz.Shape
@junkdog
junkdog / .grc.conf
Created October 21, 2022 07:47
grc stuff
# VERBOSE
regexp=\sV/[\w.]+:
colours=bold black
-
# DEBUG
regexp=\sD/[\w.]+:
colours=green
-
# INFO
regexp=\sI/[\w.]+:
package sift.instrumenter.deprecated
import sift.core.entity.Entity
import sift.core.InstrumenterService
import sift.core.api.Action
import sift.core.api.Dsl
import sift.core.api.Dsl.classes
import sift.core.entity.EntityService
import sift.core.tree.EntityNode
import sift.core.tree.Tree
package org.bouncycastle.crypto;
/**
* A wrapper class that allows block ciphers to be used to process data in
* a piecemeal fashion. The BufferedBlockCipher outputs a block only when the
* buffer is full and more data is being added, or on a doFinal.
* <p>
* Note: in the case where the underlying cipher is either a CFB cipher or an
* OFB one the last block may not be a multiple of the block size.
pipeline {
agent {
docker {
image 'junkdog/mvn-3-jdk8'
// -u root for /root/.m2 to be resolved
args '-v /root/.m2:/root/.m2 -u root'
}
}
options {
skipStagesAfterUnstable()