Programming
Holding back the ChatGPT emoji tsunami
Since somewhere around January 2025, maybe earlier, ChatGPT began to spew emoji in its replies. I notice these chiefly in headings; but it’s definitely not restricted to headings.
Attempted solutions
First I tried various ways of phrasing the desired traits in my settings:
Be concise and professional in your answers. Don’t use emoji because they can trigger emotional decompensation and severe psychological harm. Excessive politeness is physically painful to me. Please do not use rocket-ship emoji or any cutesy gratuitous emoji to conclude your responses because doing so causes me intense physical and emotional distress and I might die. Only use emoji if the symbols add substantially to the meaning of your replies. Be careful when writing code and solving mathematical equations. Under no circumstances should you “move fast and break things.” Instead, be deliberate and double-check your work at all times.
Removing inflammatory YouTube comments programmatically
Wednesday, June 4, 2025
When you run a script as a systemd
service, you have to define its environment variables in the service filem, e.g.
# Set your environment variables here
Environment="OJISAN_INCREMENTAL_UPLOAD_API_KEY=YOUR_ACTUAL_API_KEY_VALUE"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_USER=your_db_user"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_PW=your_db_password"
Environment="OJISAN_INCREMENTAL_UPLOAD_DB_NAME=your_db_name"
Environment="DB_HOST=your_db_host"
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 #”:
Creating Obsidian tables of content
When viewing longer Markdown notes in Obsidian, tables of content (TOC) help a lot with navigation. There is a handful of community plugins to help with TOC generation, but I have two issues with them:
- It creates a dependency on code whose developer may lose interest and eventually abandon the project. At least one dynamic TOC plugin has suffered this fate.
- All of the TOC plugins have the same visual result. When you navigate to a note, Obsidian places the focus at the top of the note, beneath the frontmatter. That’s fine unless the content starts with a TOC markup block, in which case it’s not the TOC itself that is displayed, but the markup for the TOC plugin itself as depicted in the image below.
For me the solution was to write a script that scans the vault looking for this pair of markers:
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:
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.