Simon Willison: TIL

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

Atom feed

Browse by topic: amplitude 1 · asgi 1 · auth0 2 · aws 8 · awslambda 1 · azure 1 · bash 9 · caddy 1 · clickhouse 1 · cloudflare 1 · cloudrun 8 · cocktails 3 · cookiecutter 2 · cooking 1 · datasette 10 · deno 1 · digitalocean 1 · django 16 · docker 9 · duckdb 1 · electron 6 · firefox 1 · fly 7 · gis 2 · git 5 · github 13 · github-actions 23 · google-sheets 1 · googlecloud 5 · gpt3 5 · graphql 3 · heroku 3 · homebrew 5 · html 3 · ics 1 · imagemagick 2 · javascript 14 · jinja 2 · jq 6 · json 1 · jupyter 1 · kubernetes 2 · linux 4 · llms 1 · macos 14 · markdown 3 · mastodon 4 · mediawiki 1 · networking 1 · nginx 1 · node 1 · npm 3 · observable-plot 2 · pixelmator 1 · pluggy 1 · postgresql 6 · presenting 1 · purpleair 1 · pypi 1 · pytest 17 · python 46 · quarto 1 · readthedocs 5 · reddit 1 · selenium 2 · service-workers 1 · shot-scraper 3 · spatialite 4 · sphinx 3 · sql 4 · sqlite 38 · svg 1 · tailscale 1 · tesseract 1 · twitter 3 · typescript 1 · vega 1 · vim 1 · vscode 2 · web-components 1 · webassembly 2 · webauthn 1 · wikipedia 1 · zeit-now 2 · zsh 2

Recent TILs

mastodon Building Mastodon bots with GitHub Actions and toot - 2023-02-02

Twitter announced today that they'll be ending free API access for bots. …

webassembly Run Python code in a WebAssembly sandbox - 2023-02-02

I've been trying to figure this out for ages. Tim Bart responded to my call for help on Hacker News with this extremely useful code example showing how to run Python code in WebAssembly inside Python, using wasmtime-py and the new Python WASM build released by VMware Wasm Labs. …

llms Running nanoGPT on a MacBook M2 to generate terrible Shakespeare - 2023-02-01

nanoGPT is Andrej Karpathy's "simplest, fastest repository for training/finetuning medium-sized GPTs". …

python Calculating embeddings with gtr-t5-large in Python - 2023-01-31

I've long wanted to run some kind of large language model on my own computer. Now that I have a M2 MacBook Pro I'm even more keen to find interesting ways to keep all of those CPU cores busy. …

sql Using recursive CTEs to explore hierarchical Twitter threads - 2023-01-30

This TIL adapted from a Gist I put together in 2019, before I started tracking TILs here. …

sqlite Combining CTEs and VALUES in SQLite - 2023-01-29

Here's how to use SQLite's VALUES syntax with a CTE to create a temporary table that you can then perform joins against in a query: …

python Installing lxml for Python on an M1/M2 Mac - 2023-01-27

I ran into this error while trying to run pip install lxml on an M2 Mac, inside a virtual environment I had intitially created using pipenv shell: …

sqlite SQLite pragma_function_list() - 2023-01-27

The SQLite pragma_function_list() table-valued function returns a list of functions that have been registered with SQLite, including functions that were added by extensions. …

git Rewriting a Git repo to remove secrets from the history - 2023-01-24

I decided to make a GitHub repository public today that had previously been private. Unfortunately the revision history of that repository included some secret values, one of which I could not figure out a way to revoke. …

python Upgrading a pipx application to an alpha version - 2023-01-11

I wanted to upgrade my git-history installation to a new alpha version. …

shot-scraper Scraping the Sky News Westminster Accounts, a Flourish application - 2023-01-10

Sky News in partnership with Tortoise published a fantastic piece of investigative data reporting: the Westminster Accounts, a database of money in UK politics that brought together data from three different sources and make it explorable. …

sqlite Loading SQLite extensions in Python on macOS - 2023-01-07

I finally found a workaround for this error when attempting to load a SQLite extension in Python on macOS: …

sqlite Geopoly in SQLite - 2023-01-04

I noticed this morning that one of my Datasette installations had the Geopoly SQLite extension enabled. I don't know how it got there - it has to be compiled specifically - but since it was there I decided to try it out. …

cooking Breakfast tacos with eggs, vegetarian sausages and avocado sauce - 2023-01-02

Ingredients (serves 2) …

clickhouse Querying the GitHub archive with the ClickHouse playground - 2022-12-31

Via this comment on Hacker News I started exploring the ClickHouse Playground. It's really cool, and among other things it allows CORS-enabled API hits that can query a decade of history from the GitHub events archive in less than a second. …

bash Start, test, then stop a localhost web server in a Bash script - 2022-12-17

I wanted to write a bash script that would start a Datasette server running, run a request against it using curl, then stop the server again. …

sqlite Comparing database rows before and after with SQLite JSON functions - 2022-12-14

Here's a trick I've been using to compare the rows in a table before and after I perform an operation against it. It works well for a few hundred (and maybe a few thousand) rows. …

sqlite SQLite can use more than one index for a query - 2022-12-11

I was trying to figure out if SQLite has the ability to use more than one index as part of executing a single query, or if it only ever picks a single index that it thinks will give the best performance. …

spatialite Viewing GeoPackage data with SpatiaLite and Datasette - 2022-12-11

I managed to display polygons fom a GeoPackage database file today, using SpatiaLite and Datasette. …

pytest Show files opened by pytest tests - 2022-12-11

My test suite for Datasette has grown so large that running the whole thing sometimes causes me to run out of file handles. …

gpt3 Reformatting text with Copilot - 2022-12-09

I wanted to write alt text for the following screenshot (of this page), so I could include it in this post on Mastodon. …

github Finding uses of an API with the new GitHub Code Search - 2022-12-08

The GitHub Code Search beta is really powerful - it allows advanced search - including regular expression matches - against every public repo on GitHub. …

googlecloud Workaround for google-github-actions/setup-gcloud errors - 2022-12-01

I used the google-github-actions/setup-gcloud action in all of my GitHub Actions workflows that deploy applications to Cloud Run. …

docker Using pipenv and Docker - 2022-11-28

I had a Django project that used pipenv (in particular a Pipfile.lock) to manage dependencies and I wanted to build a Docker container for it. …

github-actions actions/setup-python caching for setup.py projects - 2022-11-28

I used to use a combination of actions/setup-python and actions/cache in all of my Python GitHub Actions projects in order to install Python dependencies via a cache, rather than hitting PyPI to download copies every time. …

html Lazy loading images in HTML - 2022-11-26

Most modern browsers now include support for the loading="lazy" image attribute, which causes images not to be loaded unti the user scrolls them into view. …

datasette Writing a CLI utility that is also a Datasette plugin - 2022-11-21

I'm working on dclient, a CLI tool for interacting with Datasette instances via the Datasette API. …

observable-plot Wider tooltip areas for Observable Plot - 2022-11-21

In this Observable notebook I'm plotting a line on a chart, but I want to provide tooltips showing the exact value at any point on the line. …

mastodon Verifying your GitHub profile on Mastodon - 2022-11-16

Mastodon has a really neat way of implementing verification, using the rel=me microformat. …

git How to create a tarball of a git repository using "git archive" - 2022-11-15

I figured this out in a Gist in 2016 which has attracted a bunch of comments over the years. Now I'm upgrading it to a retroactive TIL. …

Browse all 380 TILs