Simon Willison: TIL

Things I've learned, collected in simonw/til. You may also enjoy my blog.

Atom feed

Browse by topic: ab 1 · amplitude 1 · asgi 1 · auth0 2 · aws 8 · awslambda 1 · azure 1 · bash 11 · caddy 1 · chrome 1 · clickhouse 2 · cloudflare 4 · cloudrun 8 · cocktails 3 · cookiecutter 2 · cooking 1 · cosmopolitan 1 · css 2 · datasette 18 · deno 3 · digitalocean 1 · discord 1 · django 18 · docker 9 · duckdb 3 · electron 6 · exif 1 · firefox 1 · fly 10 · gis 4 · git 7 · github 16 · github-actions 27 · go 1 · google 2 · google-sheets 1 · googlecloud 6 · gpt3 11 · graphql 3 · hacker-news 1 · ham-radio 1 · heroku 3 · homebrew 6 · html 5 · http 1 · httpx 1 · ics 1 · imagemagick 2 · ios 1 · javascript 16 · jinja 3 · jq 8 · json 3 · jupyter 1 · kubernetes 2 · linux 4 · llms 14 · machinelearning 1 · macos 25 · markdown 3 · mastodon 4 · mediawiki 1 · midjourney 1 · misc 2 · networking 2 · nginx 1 · node 1 · npm 5 · observable 1 · observable-plot 2 · overture-maps 1 · pixelmator 1 · playwright 2 · pluggy 1 · postgresql 7 · presenting 1 · purpleair 1 · pyodide 1 · pypi 2 · pytest 21 · python 60 · quarto 1 · readthedocs 7 · reddit 1 · selenium 2 · service-workers 1 · shot-scraper 5 · spatialite 4 · sphinx 4 · sql 5 · sqlite 53 · svg 1 · tailscale 1 · tesseract 1 · twitter 3 · typescript 1 · valtown 1 · vega 1 · vim 1 · vscode 2 · web-components 1 · webassembly 2 · webauthn 1 · wikipedia 1 · yaml 1 · zeit-now 2 · zsh 2

Recent TILs

playwright Testing HTML tables with Playwright Python - 2024-09-03

I figured out this pattern today for testing an HTML table dynamically added to a page by JavaScript, using Playwright Python: …

pytest Using namedtuple for pytest parameterized tests - 2024-08-31

I'm writing some quite complex pytest parameterized tests this morning, and I was finding it a little bit hard to read the test cases as the number of parameters grew. …

sqlite Using sqlite-vec with embeddings in sqlite-utils and Datasette - 2024-08-11

Alex Garcia's sqlite-vec SQLite extension provides a bunch of useful functions for working with vectors inside SQLite. …

django Using pytest-django with a reusable Django application - 2024-08-07

I published a reusable Django application today: django-http-debug, which lets you define mock HTTP endpoints using the Django admin - like /webhook-debug/ for example, configure what they should return and view detailed logs of every request they receive. …

github Assistance with release notes using GitHub Issues - 2024-08-05

I like to write the release notes for my projects by hand, but sometimes it can be useful to have some help along the way. …

git Back-dating Git commits based on file modification dates - 2024-08-01

I fell down a bit of a rabbit hole this morning. In trying to figure out where the idea of celebrating World Wide Web Day on August 1st came from I ran across Tim Berner-Lee's original code for the WorldWideWeb application for NeXT on the W3C's website: …

html HTML video with subtitles - 2024-07-31

Via Mariatta I found my PyVideo speaker page, and thanks to that page I learned that a talk I gave in 2009 had been rescued from the now-deceased Blip.tv and is now hosted by the Internet Archive: …

python Trying out free-threaded Python on macOS - 2024-07-12

Inspired by py-free-threading.github.io I decided to try out a beta of Python 3.13 with the new free-threaded mode enabled, which removes the GIL. …

macos Accessing 1Password items from the terminal - 2024-07-09

I save things like API keys in 1Password. Today I figured out how to access those from macOS terminal scripts. …

pytest Mocking Stripe signature checks in a pytest fixture - 2024-07-01

I'm writing some code that accepts webhooks from Stripe. I wanted to simulate hits to this endpoint in my Django tests. Stripe uses a Stripe-Signature header and I wanted a way to mock my code so that I didn't need to calculate the correct signature. …

npm Running Prettier against Django or Jinja templates - 2024-06-19

I really like auto-formatting tools like Black. I've been hoping to find one that works with Django and Jinja templates for years. …

postgresql Upgrade Postgres.app on macOS - 2024-06-15

I've been using Postgres.app to run PostgreSQL on my Mac for years. I like that it's easy to install, gives me a task tray icon to control it and means I don't have to run a full Docker environment just to hack on projects like my blog. …

cloudflare Cloudflare redirect rules with dynamic expressions - 2024-05-29

I wanted to ensure https://niche-museums.com/ would redirect to https://www.niche-museums.com/ - including any path - using Cloudflare. …

ios Listen to a web page in Mobile Safari - 2024-05-21

I found a better way to listen to a whole web page through text-to-speech on Mobile Safari today. …

ham-radio How I studied for my Ham radio general exam - 2024-05-11

I scraped a pass on my Ham radio general exam today, on the second attempt (you can retake on the same day for an extra $15, thankfully). …

macos Transcribing MP3s with whisper-cpp on macOS - 2024-04-26

I asked on Twitter for tips about running Whisper transcriptions in the CLI on my Mac. Werner Robitza pointed me to Homebrew's whisper-cpp formula, and when I complained that it didn't have quite enough documentation for me to know how to use it Werner got a PR accepted adding the missing details. …

macos A script to capture frames from a QuickTime video - 2024-04-16

I was putting together some notes for a talk I gave, and I wanted an efficient way to create screenshots of specific moments in a video of that talk. …

macos impaste: pasting images to piped commands on macOS - 2024-04-04

I wanted the ability to paste the image on my clipboard into a command in the macOS terminal. …

go Installing tools written in Go - 2024-03-25

Today I learned how to install tools from GitHub that are written in Go, using github.com/icholy/semgrepx as an example: …

chrome Google Chrome --headless mode - 2024-03-24

In the README for monolith (a new Rust CLI tool for archiving HTML pages along with their images and assets) I spotted this tip for using Chrome in headless mode to execute JavaScript and output the resulting DOM: …

clickhouse Reviewing your history of public GitHub repositories using ClickHouse - 2024-03-20

There's a story going around at the moment that people have found code from their private GitHub repositories in the AI training data known as The Stack, using this search tool: https://huggingface.co/spaces/bigcode/in-the-stack

npm Running self-hosted QuickJS in a browser - 2024-03-20

I want to try using QuickJS compiled to WebAssembly in a browser as a way of executing untrusted user-provided JavaScript in a sandbox. …

python Programmatically comparing Python version strings - 2024-03-17

I found myself wanting to compare the version numbers 0.63.1, 1.0 and the 1.0a13 in Python code, in order to mark a pytest test as skipped if the installed version of Datasette was pre-1.0. …

cloudflare Redirecting a whole domain with Cloudflare - 2024-03-15

I had to run this site on til.simonwillison.org for 24 hours due to a domain registration mistake I made. …

sqlite SQLite timestamps with floating point seconds - 2024-03-13

Today I learned about this: …

google Generating URLs to a Gmail compose window - 2024-03-12

I wanted to send out a small batch of follow-up emails for workshop attendees today, and I realized that since I have their emails in a database table I might be able to semi-automate the process. …

javascript Using packages from JSR with esbuild - 2024-03-02

JSR is a brand new package repository for "modern JavaScript and TypeScript", launched on March 1st by the Deno team as a new alternative to npm

sqlite Tracking SQLite table history using a JSON audit log - 2024-02-26

I continue to collect ways of tracking the history of a table of data stored in SQLite - see sqlite-history for previous experiments. …

valtown Running a scheduled function on Val Town to import Atom feeds into Datasette Cloud - 2024-02-20

Val Town is a neat service for hosting short server-side JavaScript programs online - reminiscent of a combination of Glitch and Observable Notebooks. …

python Getting Python MD5 to work with FIPS systems - 2024-02-13

This issue by Parand Darugar pointed out that Datasette doesn't currently run on Linux systems with FIPS enabled, due to the way it uses MD5 hashes. …

Browse all 525 TILs