Simon Willison’s Weblog

Subscribe

February 2022

52 posts: 5 entries, 12 links, 2 quotes, 33 beats

Feb. 1, 2022

TIL get-graphql-schema — The GraphQL schema language is a concise way to represent the available schema provided by a GraphQL endpoint. It looks something like this:

Feb. 2, 2022

webvm.io (via) This is one heck of a tech demo: it’s a full copy of Debian, compiled to WebAssembly and running in your browser. It’s fully stocked with Python, Perl, Ruby, Node.js and even a working gcc compiler! The underlying technology, CheerpX, is a closed-source WebAssembly virtualization platform.

# 2:29 am / debian, webassembly

TIL Testing against Python 3.11 preview using GitHub Actions — I decided to run my CI tests against the Python 3.11 preview, to avoid the problem I had when Python 3.10 came out with [a bug that affected Datasette](https://simonwillison.net/2021/Oct/9/finding-and-reporting-a-bug/).

Help scraping: track changes to CLI tools by recording their --help using Git

Visit Help scraping: track changes to CLI tools by recording their --help using Git

I’ve been experimenting with a new variant of Git scraping this week which I’m calling Help scraping. The key idea is to track changes made to CLI tools over time by recording the output of their --help commands in a Git repository.

[... 978 words]

Feb. 3, 2022

Release datasette-leaflet-freedraw 0.3.1 — Draw polygons on maps in Datasette

Feb. 4, 2022

Release sqlite-utils 3.23 — Python CLI utility and library for manipulating SQLite databases

Feb. 5, 2022

Every few weeks, someone on Twitter notices how demented the content on Facebook is. I’ve covered a lot of these stories. The quick TL;DR is that Facebook’s video section is essentially run by a network of magicians and Vegas stage performers who hack the platform’s algorithm with surreal low-value content designed to distract users long enough to trigger an in-video advertisement and anger them enough to leave a comment.

Ryan Broderick

# 10:41 pm / facebook

Feb. 6, 2022

TIL Ordered group_concat() in SQLite — I was trying to use `group_concat()` to glue together some column values into a stiched together Markdown document. My first attempt looked like this:

Feb. 7, 2022

Sha256 Algorithm Explained (via) Absolutely beautiful interactive animated explanation by Domingo Martin of the SHA256 hashing algorithm.

# 7:27 pm / algorithms, explorables

Release datasette 0.60.2 — An open source multi-tool for exploring and publishing data

Feb. 9, 2022

Release datasette-auth-passwords 1.0 — Datasette plugin for authentication using passwords

Single dependency stacks (via) Brandur Leach notes that the core services at Crunchy (admittedly a PostgreSQL hosting and consultancy company) have only one stateful dependency – Postgres. No Redis, ElasticSearch or anything else. This means that problems like rate limiting and search, which are often farmed out to external services, are all handled using either PostgreSQL or in-memory mechanisms on their servers.

# 6:43 pm / postgresql, brandur-leach

Feb. 10, 2022

GitHub Burndown (via) Neat Observable notebook by Tom MacWright—give it a GitHub access token and the name of a repo and it pulls the details of every issue and plots a burndown chart over time, showing how long issues stay open for. The code is worth spending some time with—the way it fetches data from the paginated JSON API is a really great example of using generators with Observable, and the chart itself is a lovely clear example of Observable Plot.

# 4:29 pm / github, observable, tom-macwright, observable-plot

lon lat lon lat lon. Tom MacWright’s definitive guide to the (latitude, longitude) v.s. (longitude, latitude) debate. The answer is frustrating: both orders are used by significant software, so there’s no single answer that will satisfy everyone. I’ve recently been mostly convinced over to the longitude, latitude side mainly because that’s a better fit for the non-geospatial x, y pattern.

# 4:32 pm / geospatial, tom-macwright

Feb. 11, 2022

Release datasette-publish-fly 1.1 — Datasette plugin for publishing data using Fly
TIL Annotated package.json for idb-keyval — Jake Archibald [pointed to](https://twitter.com/jaffathecake/status/1491771402294370306) his `package.json` for `idb-keyval` as a "modernish example" of NPM packaging on Twitter this morning.
Release strip-hidden-form-values 0.1 — CLI tool for stripping hidden form values from an HTML document
Release strip-hidden-form-values 0.2 — CLI tool for stripping hidden form values from an HTML document
Release strip-hidden-form-values 0.2.1 — CLI tool for stripping hidden form values from an HTML document

Feb. 12, 2022

jless (via) A really nice new command-line JSON viewer, written in Rust, created by Paul Julius Martinez. It provides a terminal interface for navigating through large JSON files, including expanding and contracting nested objects and searching for strings or a modified form of regular expressions.

# 3:17 am / json, rust

Running C unit tests with pytest (via) Brilliant, detailed tutorial by Gabriele Tornetta on testing C code using pytest, which also doubles up as a ctypes tutorial. There’s a lot of depth here—in addition to exercising C code through ctypes, Gabriele shows how to run each test in a separate process so that segmentation faults don’t fail the entire suite, then adds code to run the compiler as part of the pytest run, and then shows how to use gdb trickery to generate more useful stack traces.

# 5:14 pm / c, ctypes, testing, pytest

Feb. 13, 2022

TIL Enabling a user to execute a specific command as root without a password — I wanted a script running as a non-root user to be able to restart a systemd service on my Ubuntu machine without needing a password.

Feb. 14, 2022

Release datasette-tiddlywiki 0.2 — Run TiddlyWiki in Datasette and save Tiddlers to a SQLite database

Datasette table diagram using Mermaid (via) Mermaid is a DSL for generating diagrams from plain text, designed to be embedded in Markdown. GitHub just added support for Mermaid to their Markdown pipeline, which inspired me to try it out. Here’s an Observable Notebook I built which uses Mermaid to visualize the relationships between Datasette tables based on their foreign keys.

# 7:43 pm / dsl, github, visualization, datasette, observable, mermaid

Release datasette-publish-fly 1.1.1 — Datasette plugin for publishing data using Fly

Feb. 15, 2022

Using SQLite and Datasette with Fly Volumes

Visit Using SQLite and Datasette with Fly Volumes

A few weeks ago, Fly announced Free Postgres Databases as part of the free tier of their hosting product. Their announcement included this snippet:

[... 1,463 words]

TIL nullglob in bash — I ran into a tricky problem while working [on this issue](https://github.com/simonw/datasette-publish-fly/issues/17): the following line was behaving in an unexpected way for me:

Feb. 16, 2022

Release sqlite-utils 3.24 — Python CLI utility and library for manipulating SQLite databases
TIL Combining substr and instr to extract text — Derek Willis has [a Datasette instance full of political campaign emails](https://political-emails.herokuapp.com/) running on Heroku.
Release google-drive-to-sqlite 0.1a0 — Create a SQLite database containing metadata from Google Drive

2022 » February

MTWTFSS
 123456
78910111213
14151617181920
21222324252627
28