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

DailyBrief only worked on my disk, so I split install from per-user data
The packaged exe held my own OneDrive path and the pipeline rewrote the app's HTML page. One env var, DAILYBRIEF_DATA, now separates a read-only install from each Windows user's data.
In short
- A packaged build pointed at one hardcoded project path, and the daily pipeline also rewrote the app's own HTML page with each day's plan.
- I separated an install root (read-only, shared) from a data folder under the user's app data, chosen once in main.js and passed to every script as DAILYBRIEFDATA.
- Running a script by hand without the variable still works, because the data folder falls back to the script folder.
#electron#packaging#powershell#architecture
·6 min read

My video compressor picks a GPU encoder from a list, and never asks the GPU
ffmpeg -encoders lists what the build contains, not what the machine can run. Reading my own encoder selection code, I found a silent CPU fallback, two option vocabularies and a discarded error.
In short
- Hardware encoder choice is a substring check on ffmpeg -encoders, which lists what the build contains, not what the machine can run.
- A missing encoder silently falls back to libx264 or libx265, and the encoder options differ between the software and hardware paths.
- When a hardware encode fails, the only message the user gets is FFmpeg exited with code N.
#electron#ffmpeg#nvenc#error-handling
·6 min read

Removing a work folder in DailyBrief no longer triggers a full disk rescan
Saving the work-folder list used to rescan every root, even when I only removed one. The fix compares the effective root sets before and after and rescans only when a folder was gained.
In short
- Every save of the work-folder list cleared the cache and started a project discovery run plus a monitor run, including saves that only removed or switched off a folder.
- The handler now builds the effective root set before and after the save and rescans only if the new set contains a root the old one lacked.
- A removal now just saves, and the UI says its projects leave the list at the next scan, within 30 minutes.
#electron#nodejs#performance#powershell
·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
·5 min read

DailyBrief's run estimate averaged two programs, so I switched to a median by kind
The pre-run cost estimate averaged the last 10 runs, including ones from before the lean runner and slow outliers. A median over same-kind lean runs fixed it, with tests.
In short
- estimateRun averaged the last 10 ok runs of a mode, mixing pre-lean runs, slow outliers, and per-project checks with whole-board checks.
- The replacement is a pure module, src/estimate.js: lean-era runs only, the median of the newest 9, and runs of the same kind when there are at least 2 of them.
- Seed defaults were re-measured per kind of check, and five node:test cases pin the behaviour.
#javascript#electron#testing#estimation
·6 min read

Parallel AI checks kept overwriting my kanban board, so I added a lock and a merge
Several AI runs and the page saved the same kanban.json, and the last writer won. A shared lock file was not enough, so saves became a three-way merge.
In short
- Parallel AI checks and the user's own board saves all did read-modify-write on the same kanban.json, so the last writer dropped everyone else's changes.
- I added one lock file that both Node and PowerShell take, and a three-way merge so a page save is merged with what the scripts wrote meanwhile instead of overwriting it.
- If the lock cannot be taken, nothing is written and the user sees an error, because an unlocked write is exactly the bug being fixed.
#electron#concurrency#file-locking#powershell
·8 min read

Simple Video Compressor: an Electron app around FFmpeg and NVENC
A small Windows app that shrinks videos with FFmpeg. The interesting parts: GPU encoder selection, presets that mean different things on NVENC, and a live size estimate built from FFmpeg's stderr.
In short
- The app picks an NVENC or AMF encoder only if the bundled FFmpeg build lists it, and otherwise falls back to libx264 or libx265.
- The UI offers x264 presets such as ultrafast and veryslow, so the hardware path whitelists its own preset names and falls back to default for anything else.
- The v2 redesign (b899b60, Mar 2026) replaced a file-size poll with FFmpeg's own size= output and shows an estimated final size from two blended estimators.
#electron#ffmpeg#javascript#desktop-app
·13 min read

DailyBrief: a personal AI advisor on the desktop with PowerShell
A 391 MB digest, a mojibake fix that never worked, and a 30k-token baseline cut to 1.2k: the real bugs behind DailyBrief, a desktop AI advisor built on PowerShell and a headless Claude CLI.
In short
- The unit of planning is the project, not the folder: a registry rebuilt every 30 minutes with no AI involved.
- Scripts gather and compress activity into a small digest, the model returns a small JSON patch, and a script applies it.
- A stripped claude -p session cut the recorded per-call baseline from about 30k tokens to about 1.2k.
#ai#powershell#electron#claude