Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
37 posts
Clear filters·5 min read

TaskPad reminders: a time window instead of a flag, and a five-way hotkey fallback
TaskPad rings deadlines from the tray every 30 seconds. The design choice was to ask which deadlines fell inside the last tick, not which are overdue, plus a global hotkey that falls back through five shortcuts.
In short
- Reminders check a half-open window (last tick, now], so a deadline rings once, when it arrives, and old overdue tasks stay quiet.
- Timed deadlines get a second notification 15 minutes ahead, tracked in an in-memory set keyed by file, text and time.
- The quick-capture hotkey tries five combinations in order and uses the first one Windows lets it register.
#csharp#wpf#win32#notifications#design
·5 min read

A Jellyfin image that finishes its own setup wizard from the start script
A fresh Jellyfin server is open to whoever reaches the setup wizard first. My Pterodactyl image closes that gap by completing the wizard over HTTP from a background shell function.
In short
- Jellyfin reads its port from config/network.xml, so the start script rewrites that file on every boot to match the panel allocation.
- A background function polls the server, and if the wizard is still open it completes it with an admin account taken from environment variables.
- If the password variable is empty the script does nothing and says so, rather than inventing a default password.
#docker#bash#jellyfin#pterodactyl#security
·5 min read

TaskPad hot exit: debounced backups, an atomic session file, splits as text
Closing TaskPad never asks to save. How Session.cs keeps unsaved text across a crash: a two second debounce, a temp-file swap, ordered cleanup and a layout string like (H 0 (V 1 2)).
In short
- Session.cs writes a small tab-separated session file plus one backup-N.txt per document that has unsaved or untitled text, debounced two seconds after each edit.
- The session file is written to a temp file and swapped in with File.Replace, and stale backups are deleted only after the new file is in place.
- Window splits are saved as a tiny text language, for example (H 0 (V 1 2)), and a parse failure falls back to one empty group instead of throwing.
#csharp#wpf#persistence#editor#reliability
·5 min read

DailyBrief's eval harness: real model runs on a data copy, judged by pure functions
I could not tell whether a prompt change improved the daily brief. The harness runs the real pipeline on a copy of my data and judges it with unit-tested checks, including one for terse caveman prose.
In short
- npm run eval runs the real pipeline against a temp copy of the user's data and judges the output with plain functions, so a prompt change can be measured instead of eyeballed.
- The judging code is pure and unit-tested; it checks the brief's shape, forbidden task titles, trend-only warnings, unknown task ids and terse "caveman" prose.
- The real data folder is only read, and a before/after fingerprint warns if anything in it changed during the run.
#testing#llm#evals#powershell#nodejs
·5 min read

A BEAM image for Pterodactyl: SIGTERM, stderr-only scripts, honest hints
The BEAM answers SIGINT with a BREAK menu and waits for a key. What the Elixir and Gleam yolk does about stop signals, stdout capture and Phoenix start-up hints.
In short
- The BEAM answers SIGINT with its interactive BREAK menu and waits for a key, so the image sets STOPSIGNAL SIGTERM and lets the VM run init:stop().
- Every message from the start scripts goes to stderr, because some entrypoints capture the startup command's stdout and execute it.
- The Phoenix hints were rewritten (01c2b8f) to say what the egg does, instead of pointing at a panel tab, and to name the real fix for websocket origins.
#docker#elixir#pterodactyl#signals#bash
·5 min read

TaskPad deadlines: why due:+3d becomes a date as you type, and date-only means 23:59:59
TaskPad draws due:2026-10-10 as a live countdown pill. Relative tokens like due:+3d are rewritten into absolute dates while typing, so a deadline never drifts, and date-only means the end of that day.
In short
- A due token holds only an absolute date or time; relative forms like due:+3d or due:friday are rewritten into dates when you press space or Enter, so a deadline cannot drift.
- Date-only means the end of that day (23:59:59), and the countdown is computed at draw time and refreshed by a 30 second timer.
- Scanning is kept cheap by a plain substring check for "due" before any regex runs, and the caret line shows raw text so editing stays possible.
#csharp#wpf#avalonedit#datetime#text-editor
·5 min read

Forgejo on a Pterodactyl panel: write app.ini once, then only sed what the panel owns
The Forgejo image for Pterodactyl generates app.ini on first start and afterwards rewrites only six keys the panel controls, so hand edits survive restarts and a failed admin setup retries.
In short
- forgejo-start writes app.ini only when it does not exist, with SQLite, built-in SSH off, install locked and freshly generated secrets.
- On every start it rewrites just six keys (port, bind address, ROOTURL, DOMAIN, registration switch, RUNUSER) with sed, so manual edits to the rest of the file survive.
- The administrator is created once, guarded by a marker file that is written only on success, so a failed attempt is retried on the next start.
#bash#docker#pterodactyl#forgejo#idempotency
·5 min read

DailyBrief's board file only grew, so I added a daily compactor that moves, never deletes
Every AI run in DailyBrief reads kanban.json, and that file only ever appended. A 169-line PowerShell script now moves old notes and finished tasks into an archive once a day, losslessly.
In short
- kanban.json was append-only, and every digest and AI check re-read all of it, so each run cost more than the last.
- core/compact-kanban.ps1 moves old aiNotes and tasks finished or deleted more than 30 days ago into kanban-archive.json, once a day, under the board lock.
- Nothing is deleted: items move whole with their comments and ids, the script is idempotent, and it writes the archive before it shrinks the board.
#powershell#electron#json#performance#data-retention