Simon Willison’s Weblog

Subscribe

January 2022

50 posts: 7 entries, 14 links, 3 quotes, 26 beats

Jan. 3, 2022

Museum Shakespeare Society of America — 7981 Moss Landing Road, Moss Landing, CA 95039

Jan. 4, 2022

Weeknotes: Taking a break in Moss Landing

Visit Weeknotes: Taking a break in Moss Landing

Took some time off. Saw some whales and sea otters. Added a new spot to Niche Museums.

[... 578 words]

TIL Adding a CORS policy to an S3 bucket — Amazon S3 buckets that are configured to work as public websites can support CORS, allowing assets such as JavaScript modules to be loaded by JavaScript running on other domains.

Jan. 6, 2022

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

Crypto creates a massively multiplayer online game where the game is "currency speculation", and it's very realistic because it really is money, at least if enough people get involved. [...] NFTs add another layer to the game. Instead of just currency speculation, you're now simulating art speculation too! The fact that you don't actually own the art and the fact that the art is randomly generated cartoon images of monkeys is entirely beside the point: the point is the speculation, and winning the game by making money. This is, again, a lot of fun to some people, and in addition to the piles of money they also in some very limited sense own a picture of a cartoon monkey that some people recognize as being very expensive, so they can brag without having to actually post screenshots of their bank balance, which nobody believed anyway.

Laurie Voss

# 7:35 am / bitcoin, laurie-voss

Jan. 8, 2022

Hashids (via) Confusingly named because it’s not really a hash—this library (available in 40+ languages) offers a way to convert integer IDs to and from short strings of text based on a salt which, if kept secret, should help prevent people from deriving the IDs and using them to measure growth of your service. It works using a base62 alphabet that is shuffled using the salt.

# 7:31 pm / ids

Release stream-delay 0.1 — Stream a file or stdin one line at a time with a delay
TIL Writing pytest tests against tools written with argparse — I usually build command-line tools using [Click](https://click.palletsprojects.com/) (and my [click-app](https://github.com/simonw/click-app) cookiecutter template), which includes a really nice [set of tools](https://click.palletsprojects.com/en/8.0.x/testing/) for writing tests.

Jan. 9, 2022

Before May 2021, the master key in MetaMask was called the “Seed Phrase”. Through user research and insights from our customer support team, we have concluded that this name does not properly convey the critical importance that this master key has for user security. This is why we will be changing our naming of this master key to “Secret Recovery Phrase”. Through May and June of 2021, we will be phasing out the use of “seed phrase” in our application and support articles, and eventually exclusively calling it a “Secret Recovery Phrase.” No action is required, this is only a name change. We will be rolling this out on both the extension and the mobile app for all users.

MetaMask Support

# 5:44 am / copywriting, security

Jan. 10, 2022

TIL Testing a Click app with streaming input — For [sqlite-utils#364](https://github.com/simonw/sqlite-utils/issues/364) I needed to write a test for a [Click](https://click.palletsprojects.com/) app which dealt with input streamed to standard input. I needed to run some assertions during that process, which ruled out the usual [CliRunner.invoke()](https://click.palletsprojects.com/en/8.0.x/testing/) testing tool since that works by running the command until completion.

Jan. 11, 2022

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

What’s new in sqlite-utils 3.20 and 3.21: --lines, --text, --convert

sqlite-utils is my combined CLI tool and Python library for manipulating SQLite databases. Consider this the annotated release notes for sqlite-utils 3.20 and 3.21, both released in the past week.

[... 2,456 words]

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

Jan. 12, 2022

Release datasette-graphql 2.0.1 — Datasette plugin providing an automatic GraphQL API for your SQLite databases

How I build a feature

I’m maintaining a lot of different projects at the moment. I thought it would be useful to describe the process I use for adding a new feature to one of them, using the new sqlite-utils create-database command as an example.

[... 2,850 words]

Jan. 13, 2022

Announcing Parcel CSS: A new CSS parser, compiler, and minifier written in Rust! An interesting thing about tools like this being written in Rust is that since the Rust-to-WASM pipeline is well trodden at this point, the live demo that this announcement links to runs entirely in the browser.

# 8:40 pm / css, rust, webassembly

Jan. 14, 2022

Release datasette 0.60 — An open source multi-tool for exploring and publishing data
Release datasette-leaflet-freedraw 0.3 — Draw polygons on maps in Datasette
Release datasette-pretty-traces 0.4 — Prettier formatting for ?_trace=1 traces

Datasette 0.60: The annotated release notes

I released Datasette 0.60 today. It’s a big release, incorporating 61 commits and 18 issues. Here are the annotated release notes.

[... 1,119 words]

Jan. 15, 2022

TIL Configuring Dependabot for a Python project — GitHub's Dependabot can automatically file PRs with bumps to dependencies when new versions of them are available.

Writing a minimal Lua implementation with a virtual machine from scratch in Rust. Phil Eaton implements a subset of Lua in a Rust in this detailed tutorial.

# 6:29 pm / compilers, lua, rust, phil-eaton

Jan. 16, 2022

TIL JavaScript date objects — A few notes on JavaScript `Date` object, based on trying to do some basic things with them in Observable notebooks.

Abusing AWS Lambda to make an Aussie Search Engine (via) Ben Boyter built a search engine that only indexes .au Australian websites, with the novel approach of directly compiling the search index into 250 different ~40MB large lambda functions written in Go, then running searches across 12 million pages by farming them out to all of the lambdas and combining the results. His write-up includes all sorts of details about how he built this, including how he ran the indexer and how he solved the surprisingly hard problem of returning good-enough text snippets for the results.

# 8:52 pm / aws, go, lambda, search

Jan. 17, 2022

SQLime: SQLite Playground (via) Anton Zhiyanov built this useful mobile-friendly online playground for trying things out it SQLite. It uses the sql.js library which compiles SQLite to WebAssembly, so it runs everything in the browser—but it also supports saving your work to Gists via the GitHub API. The JavaScript source code is fun to read: the site doesn’t use npm or Webpack or similar, opting instead to implement everything library-free using modern JavaScript modules and Web Components.

# 7:08 pm / javascript, sqlite, web-components, webassembly, anton-zhiyanov

TIL Streaming indented output of a JSON array — I wanted to produce the following output from a command-line tool:

Jan. 18, 2022

Release s3-credentials 0.9 — A tool for creating credentials for accessing S3 buckets

Weeknotes: s3-credentials prefix and Datasette 0.60

Visit Weeknotes: s3-credentials prefix and Datasette 0.60

A new release of s3-credentials with support for restricting access to keys that start with a prefix, Datasette 0.60 and a write-up of my process for shipping a feature.

[... 1,134 words]

Tricking Postgres into using an insane – but 200x faster – query plan. Jacob Martin talks through a PostgreSQL query optimization they implemented at Spacelift, showing in detail how to interpret the results of EXPLAIN (FORMAT JSON, ANALYZE) using the explain.dalibo.com visualization tool.

# 8:53 pm / performance, postgresql, optimization

TIL json_extract() path syntax in SQLite — Several of the [SQLite JSON functions](), such as `json_extract()` and `json_array_length()`, take a path argument. This uses custom syntax along the lines of `$.a[2].b`, as described [in the documentation here](https://sqlite.org/json1.html#path_arguments).

2022 » January

MTWTFSS
     12
3456789
10111213141516
17181920212223
24252627282930
31