My blog posts on coding, tech, and random thoughts.
Loading the right environment variables when I cd into a project used to mean sourcing .env files by hand or leaking secrets into my global shell. direnv fixes both by loading a per-directory shell environment, and unloading it the moment I leave.
I keep most of my work inside the terminal. Here's how I use gh to create repos, track issues, and merge pull requests without touching the GitHub website.
A critical CVE in an indirect dependency, an inactive upstream, and a release deadline. Here's how I handled it: fork, patch, publish to npm, plan the exit.
The ! at the end of a TypeScript expression tells the compiler you know the value isn't null or undefined. It's the same idea as force unwrapping in Swift. Useful, but worth understanding before reaching for it.
process.env only runs in Node. It won't work in the browser. import.meta is the module-aware alternative, and it works with TypeScript too.
A feature flag is an if/else around a piece of code, controlled by an environment variable. It lets you merge and deploy work-in-progress without turning it on. Fewer conflicts, safer releases.
GitHub switched the default branch name from master to main in 2020. One line in your global git config means you never have to set it manually on a new repo again.
Google uses structured data to understand what's on your page. JSON-LD is the recommended format. Here's a minimal React component to add it, and how to verify it works.
Instead of building a custom share UI, you can hand off to the OS share sheet with one function call. navigator.share() works on mobile browsers. Here's how to use it.
I kept committing with my personal email on work projects. Git's includeIf directive fixes this by loading a different config based on which directory you're in. No manual switching.