RSSAmplifier

Blog

alexwlchan’s notes

Alex Chan’s notes

alexwlchan.netRSS feed ↗25 posts

Latest posts

Curious clocks and colourful eyes

There's a cave-dwelling fish that doesn't follow the light of the sun, and a reindeer that changes eye colour to find lichen.

Track which templates are used by Jinja2

Override the `get_template` method on the `Environment` and see which templates are summoned.

Archeologists distinguish between “sherds” and “shards”

A sherd is made of ceramic, while a shard is made of glass or metal.

A single command to test all my changed Go packages

go test $(git ls-files --modified | xargs dirname | uniq | xargs -I '{}' echo "./{}")

Disable the new message animations in WhatsApp

Look for the toggle in Settings > Animations > Messages.

Finding high-churn folders that bother Backblaze

I looked at log files in `bzreports_lastfilestransmitted` to work out which folders were generating new content.

Always-on SSH agent forwarding with my Git pushes

If I want to use `ssh -A` every time I do a Git push, I need to add the remote host to my `~/.ssh/config`.

Managing the caption of a photo with AppleScript (but not PhotoKit)

Get/set the `description` of the corresponding `media item` in the Photos app.

Goodhart’s and Campbell’s Law are different

Goodhart describes the value of a measure, while Campbell highlights the social pressure and corruption caused by one.

Notes from <em>The Cornishman</em> No. 176 (Spring 2026)

Sheep at the station, trains on the road, and cracks in the boiler.

GitUp can’t diff text files larger than 8MB

Larger files don't appear in the diff view; they're just shown as a file icon.

Format “human-readable” JSON with FracturedJSON &rarr;

Short objects and arrays are compressed onto a single line; larger objects are displayed as a table. Available in a variety of languages.

Testing the width of a page on a mobile device using Playwright

Create a new browser context with a narrow screen, then get `document.body.scrollWidth` to get the width of the displayed page.

Disable AirPods charging notifications

In Settings > Bluetooth, I can stop my iPhone telling me that my AirPods have charged overnight.

Start a Caddy server in a subprocess during a Python session

Start the server with `subprocess.Popen`, poll until it's available, yield the base URL, then clean up the process when you're done.

Filter a list of JSON object based on a list of tags

Use the `arrays` filter to remove empty values, the `any(…)` filter to check for set inclusion, then wrap the whole thing in square brackets.

HOME_GET_ME_HOME is a Citymapper Shortcuts action

It's a Citymapper action that gives directions to my home, which can be triggered using the Shortcuts app.

The <code>FileExistsError</code> exception exposes a <code>filename</code> attribute

The `filename` attribute returns the name of the already-existent file as a string.

The red-lined bubble snail

It's a species of sea snail found in the Indo-Pacific with a funky red, blue and white colouring.

Why can’t Python connect to example.com?

The Python SSL libraries only know about the certificates sent by the server and in my local store. They can't retrieve missing certificates.

Useful type hints for Python

A collection of non-obvious type hints that I couldn't easily find in documentation or Google searches.

How to truncate the middle of long command output

Use a command group `{ head -n 3; echo '[…]'; tail -n 5; }` to snip print the first few and last few lines.

AirPlay Receiver can interfere with Flask apps

It listens on port 5000, which is the default port used for running Flask apps in debug mode, then Safari sends blank pages for my Flask app.

What’s the <code>main</code> prefix in SQLite queries?

SQLite uses schema prefixes like `main` and `temp` to disambiguate between attached databases and connection-specific temporary tables.

The file(1) command can read SQLite databases

It can identify a SQLite database and give you basic information about the version, page count, encoding, and more.