Simon Willison’s Weblog

Subscribe

July 2020

88 posts: 6 entries, 21 links, 7 quotes, 54 beats

July 23, 2020

TIL Implementing a "copy to clipboard" button — I had to figure this out while building [datasette-copyable](https://github.com/simonw/datasette-copyable/) - demo [here](https://covid-19.datasettes.com/covid/ny_times_us_counties.copyable?state=Texas&county=Harris).

Weeknotes: datasette-copyable, datasette-insert-api

Visit Weeknotes: datasette-copyable, datasette-insert-api

Two new Datasette plugins this week: datasette-copyable, helping users copy-and-paste data from Datasette into other places, and datasette-insert-api, providing a JSON API for inserting and updating data and creating tables.

[... 953 words]

July 25, 2020

If you have to repeat yourself, you weren’t clear enough the first time. However, if you're talking about something brand new, you may have to repeat yourself for years before you're heard. Pick your repeats wisely.

The Basecamp Guide to Internal Communication

# 3:07 pm / basecamp, communication

Release datasette-insert 0.5 — Datasette plugin for inserting and updating data

Doing Stupid Stuff with GitHub Actions (via) I love the idea here of running a scheduled action once a year that deliberately fails, causing GitHub to send you a “Happy New Year” failure email!

# 9:19 pm / github, github-actions

TIL PostgreSQL full-text search in the Django Admin — Django 3.1 introduces PostgreSQL `search_type="websearch"` - which gives you search with advanced operators like `"phrase search" -excluding`. James Turk [wrote about this here](https://jamesturk.net/posts/websearch-in-django-31/), and it's also in [my weeknotes](https://simonwillison.net/2020/Jul/23/datasette-copyable-datasette-insert-api/).

PostgreSQL full-text search in the Django Admin. Today I figured out how to use PostgreSQL full-text search in the Django admin for my blog, using the get_search_results method on a subclass of ModelAdmin.

# 11:05 pm / django, django-admin, postgresql, search

pypi-rename. I wanted to rename a PyPI package (renaming datasette-insert-api to datasette-insert as it’s about to grow some non-API features). PyPI recommend uploading a final release under the old name which points to (and depends on) the new name. I’ve built a cookiecutter template to codify that pattern.

# 11:07 pm / projects, pypi, cookiecutter

Organizations adopt microservices when the logistical overhead of coordinating teams against a monolith becomes so large that it starts affecting product velocity. Microservices are a way to release that organizational/logistical friction, at great technical cost.

sagichmal

# 11:43 pm / microservices

July 26, 2020

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

July 27, 2020

Release datasette-render-images 0.3 — Datasette plugin that renders binary blob images using data-uris
Release datasette-render-images 0.3.1 — Datasette plugin that renders binary blob images using data-uris
Release sqlite-utils 2.12 — Python CLI utility and library for manipulating SQLite databases

sqlite-utils 2.12 (via) I’ve been experimenting with ways of improving BLOB support in Datasette and sqlite-utils. This new version of sqlite-utils includes a “sqlite-utils insert-files” command, which can recursively crawl directories for files and add their contents to SQLite with configurable columns containing their metadata.

I was inspired by Paul Ford who has been creating multi-GB SQLite databases of images and PDFs. It turns out that when disk space is cheap this is a pretty effective way of working with interesting corpuses of documents and images.

# 7:36 am / projects, sqlite, sqlite-utils

Release datasette-media 0.4 — Datasette plugin for serving media based on a SQL query
Release db-to-sqlite 1.3 — CLI tool for exporting tables or queries from any SQL database to a SQLite file

July 28, 2020

datasette-media 0.4. datasette-media is my Datasette plugin for serving media (e.g. images) directly from Datasette. The first version used file paths saved in a column and served the data from disk—this new version adds the ability to serve content from BLOB columns, such as those created by the new “sqlite-utils insert-files” command. It also adds configurable support for resizing images based on querystring parameters like ?w=100.

# 2:22 am / images, plugins, projects, datasette

July 29, 2020

Some SQL Tricks of an Application DBA (via) This post taught me so many PostgreSQL tricks that I hadn’t seen before. Did you know you can start a transaction, drop an index, run explain and then rollback the transaction (cancelling the index drop) to see what explain would look like without that index? Among other things I also learned what the “correlation” database statistic does: it’s a measure of how close-to-sorted the values in a specific column are, which helps PostgreSQL decide if it should do an index scan or a bitmap scan when making use of an index.

# 7:04 pm / postgresql, sql

TIL SQLite BLOB literals — I wanted to construct a string of SQL that would return a blob value:
Release datasette-media 0.5 — Datasette plugin for serving media based on a SQL query

July 30, 2020

How GPT3 Works—Visualizations and Animations. Nice essay full of custom animations illustrating how GPT-3 actually works.

# 12:58 am / machine-learning, ai, gpt-3, generative-ai, llms

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

Sandboxing and Workload Isolation (via) Fly.io run other people’s code in containers, so workload isolation is a Big Deal for them. This blog post goes deep into the history of isolation and the various different approaches you can take, and fills me with confidence that the team at Fly.io know their stuff. I got to the bottom and found it had been written by Thomas Ptacek, which didn’t surprise me in the slightest.

# 10:19 pm / sandboxing, security, thomas-ptacek, docker, fly

Fun with binary data and SQLite

This week I’ve been mainly experimenting with binary data storage in SQLite. sqlite-utils can now insert data from binary files, and datasette-media can serve content over HTTP that originated as binary BLOBs in a database file.

[... 957 words]

July 31, 2020

Release datasette-publish-vercel 0.7 — Datasette plugin for publishing data using Vercel

Why Your Christian Friends and Family Members Are So Easily Fooled by Conspiracy Theories (via) I think the title undersells this: this is a really great piece of writing on conspiracy theories, why people fall for them and why it’s so hard to dig people back out again—regardless of any particular religion, despite being written for a Christian audience.

# 6:28 pm / conspiracy

Release datasette-insert 0.6 — Datasette plugin for inserting and updating data
Release datasette-insert-unsafe 0.1 — Unsafe permissions for datasette-insert - allows all actions without authentication

2020 » July

MTWTFSS
  12345
6789101112
13141516171819
20212223242526
2728293031