Skip to content

Instantly share code, notes, and snippets.

@digitalsignalperson
digitalsignalperson / table-demo.py
Last active March 24, 2026 07:26
vibe-coded imgui table demo: 5k rows x 5k cols @ 120fps; custom drawlist rendering & IQR line plot conditional formatting
"""
Custom column-major DataFrame table renderer using imgui_bundle draw lists.
Key design constraints:
- All expensive work (stats, widths, col-to-array) is done ONCE at table creation.
- Per-frame work is O(visible_cells) only.
- Column settings and metadata are polars DataFrames.
- Settings UI shows one column at a time (search to select).
- Filtering uses polars/numpy expressions, not Python list comprehensions.
- Data generation uses numpy for bulk random data.
@digitalsignalperson
digitalsignalperson / bwrap-slirp4netns-test.sh
Created March 20, 2026 18:31
Example use of slirp4netns with bubblewrap
#!/bin/bash
status=$(mktemp -u)
mkfifo $status
# TODO error if slirp4netns not installed
set -e
cleanup() {
echo "cleanup"
@digitalsignalperson
digitalsignalperson / ,bwrap-code-session.sh
Last active March 20, 2026 18:32
Isolated vscode environments for claude code with bubblewrap
#!/bin/bash
{
cat > /dev/null << 'EOF'
This is a bubblewrap script I use to isolate claude-code from my personal computer
Environment:
- CODE_SESSION_STORAGE: Required storage location for session home folders
- CODE_CONFIG_BASENAME: The vscode ~/.config location name. Defaults to "Code - OSS". Depends on linux distribution
- CODE_EXTENSIONS_PATH: e.g. a file you can provide like `code --list-extensions > ~/.config/vscode-extensions.txt`
that will be loaded in the container's vscode
@digitalsignalperson
digitalsignalperson / ,cc-md.py
Created March 20, 2026 17:58
Simple Claude Code Session Exporter
#!/usr/bin/env python3
"""
Simple Claude Code Session Exporter
Finds sessions, lists them, exports to markdown.
Inspired by https://github.com/jimmc414/cctrace/blob/master/export_claude_session.py
"""
import json
import os
@digitalsignalperson
digitalsignalperson / uw
Created March 3, 2026 06:45
uw - a uv wrapper to run a uv "workspace" with independent uv.lock from its dependencies
#!/usr/bin/env bash
set -euo pipefail
# Walk up from CWD looking for .uw
find_uw_root() {
local dir="$PWD"
while [[ "$dir" != "/" ]]; do
if [[ -f "$dir/.uw" ]]; then
echo "$dir"
return 0
@digitalsignalperson
digitalsignalperson / uv-workspace.md
Created February 27, 2026 06:08
how im using uv workspaces atm

Disclaimer: Written by claude to turn my local projects structure into a short guide.

I also pointed it to mention the discussion from this issue astral-sh/uv#17351, as I was looking for a way to have nested projects with their own uv.lock and be be able to independently uv sync --frozen in the inner projects, while still having the convenience of an outer workspace containing everything. Another solution that seems ok is to make a sibling meta-package that acts as the workspace, using path sources to include all the sibling packages in one place.

The result:

uv Workspaces for Multi-Package Python Repos

A uv workspace lets you develop multiple Python packages in one repo with a single

@digitalsignalperson
digitalsignalperson / imgui-endpoint-viewer-sapp.cc
Last active April 23, 2025 15:20
simple python flask endpoint serving scatterplot data and drawn by a sokol+imgui WASM client
//------------------------------------------------------------------------------
// imgui-endpoint-viewer-sapp.cc
//------------------------------------------------------------------------------
#include "sokol_app.h"
#include "sokol_gfx.h"
#include "sokol_log.h"
#include "sokol_glue.h"
#include "sokol_fetch.h"
#include "imgui.h"
#include "implot.h"
#!/bin/bash
cleanup(){
[[ -n $1 ]] && rm -f "$1"
}
tempfile=$(mktemp -t screenshot-XXXXXX.png)
trap "cleanup '$tempfile'" EXIT
spectacle --fullscreen --background --nonotify --output "$tempfile" &
@digitalsignalperson
digitalsignalperson / layer-shell.c
Created January 22, 2025 08:41
using casilda with gtk4-layer-shell for drop-down terminal
// toggle visibility with `kill -USR1 $(cat /tmp/casilda-tty.pid)` (assign this as the cmdline for a global hotkey)
#include "gtk4-layer-shell.h"
#include <gtk/gtk.h>
#include "casilda-compositor.h" // https://gitlab.gnome.org/jpu/casilda
#include <unistd.h>
#include <glib-unix.h>
GtkWidget *window;
#define TTY_SOCKET "/tmp/casilda-tty.sock"
@digitalsignalperson
digitalsignalperson / obsidian-bookmarks.py
Created January 14, 2025 06:12
obsidian bookmarks to markdown
#!/bin/python
import os
import json
vault_path = "/mnt/0/obsidian/andy" # <--- SET THIS TO YOUR VAULT PATH
output_path = os.path.join(vault_path, "bookmarks.md") # <--- SET TO OUTPUT MARKDOWN FILE
format_as_list = False # <--- set to True or False to change output format
bookmarks_path = os.path.join(vault_path, ".obsidian/bookmarks.json")