Simon Willison’s Weblog

Subscribe

February 2021

80 posts: 11 entries, 11 links, 6 quotes, 52 beats

Feb. 22, 2021

Fuzzy Name Matching in Postgres. Paul Ramsey describes how to implement fuzzy name matching in PostgreSQL using the fuzzystrmatch extension and its levenshtein() and soundex() functions, plus functional indexes to query against indexed soundex first and then apply slower Levenshtein. The same tricks should also work against SQLite using the datasette-jellyfish plugin.

# 9:16 pm / postgresql, sqlite, datasette

Feb. 23, 2021

Release csv-diff 1.1 — Python CLI tool and library for diffing CSV and JSON files

I strongly suspect that the single most impactful thing I did during my 5+ years at Linden Lab was shortly before I left: set up a weekly meeting between a couple of leads from Support and Engineering to go over the top 10 support issues.

Yoz Grahame

# 4:49 am / support, management

Spinning up a new Django app to act as a backend for VaccinateCA

My goal by the end of this week is to have a working proof of concept for a Django + PostgreSQL app that can replace Airtable as the principle backend for the https://www.vaccinateca.com/ site. This proof of concept will allow us to make a go or no-go decision and figure out what else needs to be implemented before we can start using it to track calls.

[... 762 words]

When building a tool, it’s easy to forget how much you’ve internalized: how much knowledge and context you’ve assumed. Your tool can feel familiar or even obvious to you while being utterly foreign to everyone else. If your goal is for other people to use the darn thing — meaning you’re not just building for yourself, or tinkering for its own sake (which are totally valid reasons) — you gotta help people use it! It doesn’t matter what’s possible or what you intended; all that matters is whether people actually succeed in practice.

Mike Bostock

# 10:55 pm / open-source, mike-bostock, d3

Feb. 24, 2021

TIL Show the SQL schema for a PostgreSQL database — This took me longer to figure out than I care to admit.
TIL Running tests against PostgreSQL in a service container — I wanted to run some Django tests - using `pytest-django` and with Django configured to pick up the `DATABASE_URL` environment variable via [dj-database-url](https://github.com/jacobian/dj-database-url) - against a PostgreSQL server running in GitHub Actions.

Importing data from Airtable into Django, plus a search engine for all our code

I made a bunch of progress on the Django backend prototype-that-soon-won’t-be-a-prototype today.

[... 935 words]

Release github-contents 0.2 — Python class for reading and writing data to a GitHub repository

Feb. 25, 2021

Release datasette-block 0.1 — Block all access to specific path prefixes
Release datasette-block 0.1.1 — Block all access to specific path prefixes
Release datasette-auth-github 0.13.1 — Datasette plugin that authenticates users against GitHub
Release flatten-single-item-arrays 0.1 — Given a JSON list of objects, flatten any keys which always contain single item arrays to just a single value

Django admin customization, JSON in our PostgreSQL

My progress slowed a bit today as I started digging into some things I’m less familiar with—but I’ve found some tricks that I think will help us out a lot.

[... 1,089 words]

Feb. 26, 2021

TIL Adding extra read-only information to a Django admin change page — I figured out this pattern today for adding templated extra blocks of information to the Django admin change page for an object.
TIL Granting a PostgreSQL user read-only access to some tables — I wanted to grant a PostgreSQL user (or role) read-only access to a specific list of tables.

How to secure an Ubuntu server using Tailscale and UFW. This is the Tailscale tutorial I’ve always wanted: it explains in detail how you can run an Ubuntu server (from any cloud provider) such that only devices on your personal Tailscale network can access it.

# 8:31 pm / security, ubuntu, dogsheep, tailscale

Feb. 27, 2021

cosmopolitan libc (via) “Cosmopolitan makes C a build-once run-anywhere language, similar to Java, except it doesn’t require interpreters or virtual machines be installed beforehand. [...] Instead, it reconfigures stock GCC to output a POSIX-approved polyglot format that runs natively on Linux + Mac + Windows + FreeBSD + OpenBSD + BIOS with the best possible performance and the tiniest footprint imaginable.” This is a spectacular piece of engineering.

# 6:02 am / c, cosmopolitan

unasync (via) Today I started wondering out loud if one could write code that takes an asyncio Python library and transforms it into the synchronous equivalent by using some regular expressions to strip out the “await ...” keywords and suchlike. Turns out that can indeed work, and Ratan Kulshreshtha built it! unasync uses the standard library tokenize module to run some transformations against an async library and spit out the sync version automatically. I’m now considering using this for sqlite-utils.

# 10:20 pm / async, python

Feb. 28, 2021

Trying to end the pandemic a little earlier with VaccinateCA

Visit Trying to end the pandemic a little earlier with VaccinateCA

This week I got involved with the VaccinateCA effort. We are trying to end the pandemic a little earlier, by building the most accurate database possible of vaccination locations and availability in California.

[... 1,154 words]

2021 » February

MTWTFSS
1234567
891011121314
15161718192021
22232425262728