Programming
Tuesday, June 3, 2025
Show systemd
running services as a list
systemctl list-units --type=service --state=running --no-pager
Thursday, April 17, 2025
vim: Jump to specific character on a line
In Vim, to jump to a specific character on a line, you can use the following commands:
f{char}
- Jump to the next occurrence of{char}
on the current lineF{char}
- Jump to the previous occurrence of{char}
on the current linet{char}
- Jump until (one position before) the next occurrence of{char}
T{char}
- Jump until (one position after) the previous occurrence of{char}
For your specific example of “go to first #”:
When will I get to 1,000,000 Anki reviews?
Recently I’ve been wondering how long it would take me to get to 1,000,000 reviews. Right now I’m sitting at between 800,000 and 900,000 reviews and for no other reason than pure ridiculous curiosity I was curious whether I could get SQLite to compute it directly for me. Turns out the answer is “yes, you can.”
Here’s the query in its gory detail and then I’ll walk through how it works:
Registering a custom collation to query Anki database
While working on a project that requires querying the Anki database directly outside of the Anki desktop application, I encountered an interesting issue with sqlite3
collations. This is is just a short post about how I went about registering a collation in order to execute SQL queries against the Anki db.
The problem
Let’s try a simple query. Open the Anki database:
Fix your Anki streak - the script edition
An API (sort of) for adding links to ArchiveBox
POST
request. It takes advantage of the archivebox
command line interface. If you are impatient, you can skip to the full source code. Otherwise I’ll describe my setup to provide some context.
A Keyboard Maestro action to save bookmarks to Espial
So this is a little esoteric, but it meets a need I encountered; and it may meet yours if you use Espial, Keyboard Maestro and are on macOS.
For several years I’ve been using Espial a bookmark manager that looks and feels like Pinboard, but is both self-hosted and drama-free1. Espial is easy to setup, stores its data in a comprehensible sqlite database and has an API, which comes in handy when it came to solving the problem I encountered.