You don't need CGO to use SQLite in your Go binary

At least not for most use cases. You can just use modernc.org/sqlite instead as your SQLite driver. For people who aren’t in the Go know, “pure” Go programs are trivially easy to compile cross-platform to all the major platforms by default. You read that right - you can just go build a single Windows executable, Mac executable, and Linux executable on the same machine and just ship it: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # This can all happen on the same box!...

July 18, 2025

Incentivize grandchildren by writing them into your will

It’s no secret that I’m a fan of economics-inspired solutions to otherwise hard problems. The other day I happened across an old post by GMU economist Bryan Caplan which I think does this very elegantly, for a problem of some interest to me. The vast majority of wills evenly divide the residuary estate between children. Mine evenly divides the residuary estate between (children and grandchildren). I like this a lot. It makes it unambiguously clear where your priorities in the case of your untimely demise lie....

July 16, 2025

The second wave of spaced repetition apps

Spaced repetition has been around for a long time. If you’ve never heard the term before, it’s best described as flashcards on timers. an algorithm such as SM-2 or the more recent FSRS keeps track of how you did on the flashcard, makes a guess as to how long it could possibly wait to show you the flashcard again before you below, say, a 90% chance of getting it right the next time, and then schedules the flashcard for a new day....

July 14, 2025

Experiment registry: Can I simply enjoy everything I do?

N.B.: If I link you to this personally, it is to explain why I usually seem to be in a great mood. It’s an experiment. I’m normally in merely a good mood, and I am pushing myself to be great. This is an unusual entry for a Today I Learned site, even by my standards. But I think it’s something I would prefer to pre-register ahead of time. I’ve always been predisposed to mirth....

July 7, 2025

Switching Vim colorschemes based on which keyboard layout I have active

Did you know Vim has a client-server model baked in? Of course it does. If you run 1 vim --servername LOVE , then in another terminal something like 1 vim --servername LOVE --remote-send "<Cmd>colorscheme peachpuff<CR>" , you’ll find your Vim terminal switch to the creamy default theme all true gangsters love - without you actually having to do anything. I frequently flip between a US- and Finnish-based keyboard while doing my language studies....

July 6, 2025

Using LLMs to generate small semantic perturbations for language learning writing practice

Still images of this GIF are at the bottom. Learning to read a language is mostly a game of getting massive quantities of comprehensible input. Learning to write that same language is a whole ’nother ballgame. But, using the 4-quadrant Anki card setup from my earlier post, I think I’m finding more and more ways to make this as amenable to spaced repetition as possible. One thing I’ve been experimenting with with surprising success is the idea of using LLMs to generate “semantic perturbations” on sentences I already “know” how to write, where “know” = “have in active review in Anki”, for our purposes....

July 4, 2025

The language learning "Delta" Anki card pattern

1 2 3 4 5 +--------------------------+------------------------------------------+ | L2, fixable | L1, intention | +--------------------------+------------------------------------------+ | L2, fixed | L1, (fixable -> fixed) explanation | +--------------------------+------------------------------------------+ The above 2x2 layout for Anki cards, which I call a “comprehensible delta”, is one of the best things I’ve happened upon in a while for learning another language. Let’s say you are learning Finnish, and you want to say Lapset tykkäävät hillosta. (The kids like jam....

June 28, 2025

Save your disk, write files directly into RAM with /dev/shm

Given my interest in extending the life of my SD cards and hard drives as much as possible, I’m surprised I haven’t come across /dev/shm before. In a word it’s a world-accessible RAM scratchpad, which seems baked right into POSIX, so that virtually every ~Unix~ EDIT: Linux system already has it mounted as a tmpfs by default: 1 2 ❯ mount | grep '/dev/shm' tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64) Today’s lucky 10,000, indeed....

June 26, 2025

LLM, JavaScript, GitHub Pages, localStorage: A recipe for free apps anyone can use

Earlier today on Hacker News Scrappy made the rounds, with the explicit tagline “make little apps for you and your friends”. I always like to see new projects in this vein. That’s why I’d like to outline my alternative approach, which Works cross-platform and on mobile devices by default, Doesn’t require any app store tomfoolery, Has great uptime built in, Gives you just enough data persistence to not get in your way, and Is owned by you, forever....

June 18, 2025

Create multi-stage Anki card answers with HTML's <details> tag

This works as of, at least, Anki 24.06.3. According to the Mozilla Developer Network, The <details> HTML element creates a disclosure widget in which information is visible only when the widget is toggled into an open state. In standard web browsers, absent any CSS to the contrary, a <details> tag starts closed until further notice. Since Anki is basically a local web browser on top of a timer, this also works there....

June 7, 2025