You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Benji Asperheim
basperheim
Full-stack dev, writer & linguist. I build web apps, explore systems (code & human), and blog on dev, etymology, and AI. Based in northern MN.
Fixing "packageManager: [email protected]" projects when Yarn 1.x is shadowing Corepack (macOS/Homebrew)
Fixing "packageManager: [email protected]" projects when Yarn 1.x is shadowing Corepack (macOS/Homebrew)
This is the "Yarn 4 project, but my shell keeps running Yarn 1.22" problem.
You'll see an error like:
This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.22.22.
...the project is meant to be used with Corepack...
Turn macOS Screen Recordings into GIFs and Screenshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a practical, opinionated guide to Python virtual environments on POSIX/macOS/Linux with a few Windows notes. It shows the cleanest workflows that don't bite you later: create/activate, install via pip and requirements.txt, run scripts with reliable logging/printing, deactivate/uninstall/remove, common gotchas, when to upgrade pip/setuptools/wheel, and a Zsh prompt that shows the active venv in red. It also explains what a venv does and doesn't do (spoiler: you can still build Go, run Docker, etc.).
Why venvs (in one paragraph)
Python versions and packages vary per project. A venv creates an isolated interpreter + site-packages so each project can pin its own dependencies without polluting system or Homebrew installs. On macOS/Homebrew you usually only have python3 globally; once you activate a venv, you get a project-local python.
Use Python/Vosk to Create Transcripts from Audio Files
Vosk Transcriber (MP3/WAV → Text)
A small Python CLI that transcribes audio using Vosk.
If you pass an .mp3, it automatically converts to a 16 kHz mono WAV via ffmpeg and then transcribes. If you pass a .wav, it transcribes directly.
Input: .mp3or.wav
Output: .txt with the same base name as the input (e.g., audio.mp3 → audio.txt)
Focused Git diffs for humans and LLMs: prints only meaningful changed files (skips assets/vendor dirs), groups by file with headers, and supports path filtering—perfect for pasting compact context into prompts.
git_diff_filtered — focused diffs for humans and LLMs
A small Bash function that prints only the meaningful parts of your Git diff, skipping asset/vendor directories and binary-ish files. Output is grouped by file with a clear header, making it ideal for quickly reviewing changes or pasting compact, high-signal code context into LLM prompts.
Why
Less noise, more signal. Excludes node_modules/, .yarn, .astro, and common binary/extensions by default.
LLM-friendly. Keeps diffs tight to save tokens and reduce hallucinations; per-file headers help models understand boundaries.
Convenient. One call prints all filtered diffs, or you can narrow to a path.
Tetris clone written in Python using the Pygame high-level SDL wrapper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fast, Flexible Directory Tree & File Preview Tool for Sharing Context with LLMs
detailed_tree.sh
A robust, cross-platform shell function for quickly sharing a directory’s structure and previewing file contents.
Ideal for collaborating with others, sharing context with ChatGPT or other LLMs, or just auditing a codebase without manually sifting through files.
Removes special LLM-injected characters from markdown files in order to "normalize" the markdown content.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters