TOML in Python
2024-05-25
I finally got around to fully learning [TOML](https://toml.io/). Some notes, including how to read and write it from Python.
677 words
|
3 minutes
Conditionally running a second job in a GitHub Actions workflow
2024-05-25
My [simonwillisonblog-backup workflow](https://github.com/simonw/simonwillisonblog-backup/blob/main/.github/workflows/backup.yml) periodically crea...
411 words
|
2 minutes
get-graphql-schema
2024-05-25
The GraphQL schema language is a concise way to represent the available schema provided by a GraphQL endpoint. It looks something like this:
297 words
|
1 minute
Running gdb against a Python process in a running Docker container
2024-05-24
While investigating [Datasette issue #1268](https://github.com/simonw/datasette/issues/1268) I found myself with a Python process that was hanging,...
185 words
|
1 minute
Packaging a Python CLI tool for Homebrew
2024-05-24
I finally figured out how to package [Datasette](https://github.com/simonw/datasette) for installation with Homebrew. My package was accepted into ...
722 words
|
4 minutes
Lag window function in SQLite
2024-05-22
Here's [how to use a lag window function](https://covid-19.datasettes.com/covid?sql=with+italy+as+%28%0D%0A++select%0D%0A++++rowid%2C%0D%0A++++day%...
141 words
|
1 minute
Running Datasette on Replit
2024-05-22
I figured out how to run Datasette on https://replit.com/
147 words
|
1 minute
Rewriting a Git repo to remove secrets from the history
2024-05-22
I decided to make a GitHub repository public today that had previously been private. Unfortunately the revision history of that repository included...
590 words
|
3 minutes
Planning parallel downloads with TopologicalSorter
2024-05-22
For [complicated reasons](https://github.com/simonw/datasette/issues/878) I found myself wanting to write Python code to resolve a graph of depende...
347 words
|
2 minutes
Using the Fly Docker registry
2024-05-21
[Fly.io](https://fly.io/) lets you deploy Docker containers that will be compiled as a Firecracker VM and run in locations around the world.
408 words
|
2 minutes
Extracting objects recursively with jq
2024-05-21
The Algolia-powered Hacker News API returns nested comment threads that look like this: https://hn.algolia.com/api/v1/items/27941108
261 words
|
1 minute
Run Python code in a WebAssembly sandbox
2024-05-21
I've been trying to figure this out for ages. Tim Bart responded to [my call for help on Hacker News](https://news.ycombinator.com/item?id=34598024...
649 words
|
3 minutes
Packaging a Python app as a standalone binary with PyInstaller
2024-05-21
[PyInstaller](https://www.pyinstaller.org/) can take a Python script and bundle it up as a standalone executable for macOS, Linux and apparently Wi...
406 words
|
2 minutes
Effective Podman Resource Management and Cleanup Strategies
2024-05-20
A comprehensive guide to efficiently managing and cleaning up Podman resources including containers, images, and volumes to maintain system performance and reclaim disk space.
1124 words
|
6 minutes
hexdump and hexdump -C
2024-05-20
While exploring null bytes in [this issue](https://github.com/simonw/ttok/issues/3) I learned that the `hexdump` command on macOS (and presumably o...
311 words
|
2 minutes
Pretty-printing all read-only JSON in the Django admin
2024-05-19
I have a bunch of models with JSON fields that are marked as read-only in the Django admin - usually because they're recording the raw JSON that wa...
172 words
|
1 minute
Mocking a Textract LimitExceededException with boto
2024-05-18
For [s3-ocr issue #21](https://github.com/simonw/s3-ocr/issues/21) I needed to write a test that simulates what happens when Amazon Textract return...
543 words
|
3 minutes
A tip for debugging pytest-httpx
2024-05-18
I use [pytest-httpx](https://colin-b.github.io/pytest_httpx/) in a bunch of my projects. Occasionally I run into test failures like this one, which...
194 words
|
1 minute
Enabling a gin index for faster LIKE queries
2024-05-18
I tried using a gin index to speed up `LIKE '%term%'` queries against a column.
216 words
|
1 minute
SQLite VACUUM: database or disk is full
2024-05-18
I was trying to run `VACUUM` against a large SQLite database file (~7GB) using `sqlite-utils vacuum data.db` and I got this error:
112 words
|
1 minute
Scroll to text fragments
2024-05-17
I ran a Google search this morning for `s3-credentials simon willison` and when I clicked on the top result it jumped me to a highlighted snippet o...
384 words
|
2 minutes
Running Ethernet over existing coaxial cable
2024-05-17
I recently noticed that the router in our garage was providing around 900 Mbps if I plugged my laptop directly into it via an Ethernet cable, but t...
437 words
|
2 minutes
Identifying column combination patterns in a SQLite table
2024-05-17
Given a large, heterogeneous table I wanted to identify patterns in the rows in terms of which columns were not null.
396 words
|
2 minutes
Outputting JSON with reduced floating point precision
2024-05-17
[datasette-leaflet-geojson](github.com/simonw/datasette-leaflet-geojson) outputs GeoJSON geometries in HTML pages in a way that can be picked up by...
149 words
|
1 minute