Open Vim Readonly

We can open Vim in read-only mode in two ways: vim -R <file> Or: view <file> A use case could be a file on a server with credentials that we want to read but be sure not to change. See man vim for more information.

August 23, 2026

If/Else in CSS

Today I got to try the experimental if/else syntax in CSS: /* Component.module.css */ img { transform: if(style(--isZoomed: true): scale(2) ; else: scale(1)); } I used it to pass a variable from React state to the stylesheet: // Component.tsx <img style={{'--isZoomed': isZoomed ? 'true' : 'false'}} /> I think conditional classes would be my preference for managing this for real, but this is an alternative. if() CSS Function — MDN

August 20, 2026

Modular CSS Classes and Elements

A goal of modular CSS is to scope styles to components. Globally styling elements like h1 is to be done sparingly. Instead, we use class syntax: /* Component.module.css */ .header { color: purple; } // Component.tsx import {styles} from './Component.module.css'; const Component = () => { return ( <section> <h1 className={styles.header}>A purple header here 💜</h1> </section> ); }; This keeps the header styles just on this element, in this component. But, we can still style elements: ...

August 20, 2026

The Power of One Test

A developer experience and quality control measure I take on programs I’m building, even small ones, is always to write at least one test. Here’s an example, from this blog: // cypress/e2e/index.cy.js it('shows the homepage', () => { cy.visit('/'); cy.get('article').should('have.length', 10); }); The test loads the homepage and confirms ten articles. The test framework, Cypress, is inconsequential– the point is the test. Should we write tests? What kind, and how many? It’s easy to overthink it; don’t. The difference between zero tests and one is massive. ...

August 20, 2026

Inspecting Symlink with readlink

There are a few ways to know that a file is a symlink. Here’s one I learned today. All my dotfiles are symlinks because I store them outside of the root directory. Here’s a conventional way to inspect a symlink: ls -l ~/.zshrc lrwxr-xr-x@ 1 jake staff 37 Jul 21 17:28 /Users/jake/.zshrc -> /Users/jake/code/dotfiles/./.zshrc How do we know it’s a symlink? The l at the beginning of the permissions list and the arrow -> are two clues. ...

August 19, 2026

Remembering the Percent as Wildcard

It’s been a bit since I was typing SQL into a REPL. One interface that didn’t come back to me right away is the percent character in a like or ilike query: select full_name from users where full_name ilike 'jake%'; Returns: full_name ----------- Jake Gyllenhaal Jake Tapper Jake Worth (3 rows) This percent sign ensures we get all the Jakes. Here’s how I’m going to remember this next time. Like everything SQL, this an ISO/ANSI standard and there’s a long lost history. If you think like me, and you might wonder why this character is not an asterisk. Here’s my new mental model to reinforce the percent sign. ...

August 19, 2026

Ripgrep files with matches

I use Ripgrep as my command-line search tool. Something I often want is to return matching filenames only, instead of Ripgrep’s rich colored output, so I can pipe them to xargs. Here’s that flag: rg -l The -l flag is short for the --files-with-matches flag. As an example, today I used it to delete all drafts from a blog project. rg -l "draft" src/content/posts/ | xargs rm See man rg for more.

August 11, 2026

Vim view all your maps

For each way you can map something in Vim, you can inspect those mappings. Check out this table of commands: COMMANDS MODES :map :noremap :unmap Normal, Visual, Select, Operator-pending :nmap :nnoremap :nunmap Normal :vmap :vnoremap :vunmap Visual and Select :smap :snoremap :sunmap Select :xmap :xnoremap :xunmap Visual :omap :onoremap :ounmap Operator-pending :map! :noremap! :unmap! Insert and Command-line :imap :inoremap :iunmap Insert :lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg :cmap :cnoremap :cunmap Command-line :tmap :tnoremap :tunmap Terminal-Job To take a very practical one, :nmap will show you all of your normal mode mappings. Find a new command to try; you are not using them all (neither am I). ...

August 8, 2026

Saving TSX's Evaluated Commands to File

We can save all evaluated commands from our TSX REPL session to a file: $ npx tsx > const name: number = "Jake" undefined > .save output.ts Session saved to: output.ts One use case would be evaluating that output with tsc to get compilation and type-checking: $ npx tsc output.ts output.ts:1:7 - error TS2322: Type 'string' is not assignable to type 'number'. 1 const name: number = "Jake" ~~~~~~~~ Found 1 error in output.ts:1 See .help inside TSX for more info about this and other meta commands. ...

July 29, 2026

Writing Prose with Vale

Want to get better at technical writing? I’ve been writing prose (READMEs, wikis, and this blog) with Vale for months. It’s helps me write better, faster. Here’s what I’ve learned. Vale is a “linter for prose.” It gives you tips like this. $ vale README.md README.md 4:3 error Did you really mean 'existant'? Vale.Spelling 6:12 warning Use 'use' instead of 'utilize'. Microsoft.Vocab 9:1 suggestion In general, use active voice. write-good.Passive ✖ 1 error, 1 warning and 1 suggestion in 1 file. It’s running in my text editor with Vim and ALE: ...

July 28, 2026