Simon Willison’s Weblog

Subscribe

TILs

Filters: Sorted by date

TIL Writing Playwright tests for a Datasette Plugin — I really like [Playwright](https://playwright.dev/) for writing automated tests for web applications using a headless browser. It's pretty easy to install and run, and it works well in GitHub Actions.
None
TIL How to get Cloudflare to cache HTML — To my surprise, if you setup a [Cloudflare](https://www.cloudflare.com/) caching proxy in front of a website it won't cache HTML pages by default, even if they are served with `cache-control:` headers.
None
TIL Running Varnish on Fly — The goal: run [Varnish](https://varnish-cache.org/) in a [Fly](https://fly.io/) container as a caching proxy in front of another Fly application.
None
TIL GitHub Actions, Issues and Pages to build a daily planner — I'm trying a new thing: a private daily planner, where each day I note down my goals for the day and make notes on my progress towards them as the day progresses.
None
TIL Running Steampipe extensions in sqlite-utils and Datasette — [Steampipe](https://steampipe.io/) build software that lets you query different APIs directly from SQL databases.
None
TIL Editing an iPhone home screen using macOS — My iPhone has a weird bug: I can no longer re-arrange the app icons on the home screen (or in the dock) by dragging them around on my phone. It lets me get into edit mode (where the icons wiggle) and drag them around, but when I release they go back to where they came from.
None
TIL Grabbing a transcript of a short snippet of a YouTube video with MacWhisper — I grabbed [a quote](https://simonwillison.net/2023/Dec/1/jeremy-howard/) from a transcript of a snippet of a YouTube video today for my blog.
None
TIL Cryptography in Pyodide — Today I was evaluating if the Python [cryptography](https://cryptography.io/) package was a sensible depedency for one of my projects.
None
TIL Running pip install '.[docs]' on ReadTheDocs — I decided to use ReadTheDocs for my in-development [datasette-enrichments](https://github.com/datasette/datasette-enrichments) project.
None
TIL Cloning my voice with ElevenLabs — Charlie Holtz published [an astonishing demo](https://twitter.com/charliebholtz/status/1724815159590293764) today, where he hooked together GPT-Vision and a text-to-speech model trained on his own voice to produce a video of Sir David Attenborough narrating his life as observed through his webcam.
None
TIL Summing columns in remote Parquet files using DuckDB — [vivym/midjourney-messages](https://huggingface.co/datasets/vivym/midjourney-messages) on Hugging Face is a large (~8GB) dataset consisting of 55,082,563 Midjourney images - each one with the prompt and a URL to the image hosted on Discord.
None
TIL A simple two column CSS grid — For my blog entry today [Now add a walrus: Prompt engineering in DALL-E 3](https://simonwillison.net/2023/Oct/26/add-a-walrus/) I wanted to display little grids of 2x2 images along with their captions.
None
TIL Serving a custom vector web map using PMTiles and maplibre-gl — [Protomaps](https://protomaps.com/) is "an open source map of the world, deployable as a single static file on cloud storage". It involves some _very_ clever technology, rooted in the [PMTiles](https://github.com/protomaps/PMTiles) file format which lets you create a single static file containing vector tile data which is designed to be hosted on static hosting but can then serve vector tiles to clients using HTTP range requests.
None
TIL Serving a JavaScript project built using Vite from GitHub Pages — I figured out how to serve a JavaScript project built using [Vite](https://vitejs.dev/) using GitHub Pages and a custom build script that runs using GitHub Actions.
None
TIL Deploying the CLIP embedding model on Fly — Inspired by [Drew Breunig's Faucet Finder](https://www.dbreunig.com/2023/09/26/faucet-finder.html) I decided I wanted to deploy an API somewhere that could calculate [CLIP embeddings](https://simonwillison.net/2023/Sep/12/llm-clip-and-chat/) for me.
None
TIL Understanding the CSS auto-resizing textarea trick — Chris Coyier [wrote about](https://chriscoyier.net/2023/09/29/css-solves-auto-expanding-textareas-probably-eventually/) the new `form-sizing: normal` property, which can get a `<textarea>` to automatically expand to fit its content - but currently only in Google Chrome Canary. Chris also linked to [his own favourite trick](https://codepen.io/chriscoyier/pen/XWKEVLy) for doing that, using some CSS grid trickery (original idea by Stephen Shaw).
None
TIL Snapshot testing with Syrupy — I'm a big fan of snapshot testing - writing tests where you compare the output of some function to a previously saved version, and can re-generate that version from scratch any time something changes.
None
TIL Geospatial SQL queries in SQLite using TG, sqlite-tg and datasette-sqlite-tg — [TG](https://github.com/tidwall/tg) is an exciting new project in the world of open source geospatial libraries. It's a single C file (an amalgamation, similar to that provided by SQLite) which implements the subset of geospatial operations that I most frequently find myself needing:
None
TIL Trying out the facebook/musicgen-small sound generation model — Facebook's [musicgen](https://huggingface.co/facebook/musicgen-small) is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.
None
TIL Limited JSON API for Google searches using Programmable Search Engine — I figured out how to use a JSON API to run a very limited Google search today in a legit, non-screen-scraper way.
None
TIL Running tests against multiple versions of a Python dependency in GitHub Actions — My [datasette-export-notebook](https://github.com/simonw/datasette-export-notebook) plugin worked fine in the stable release of Datasette, currently version [0.64.3](https://docs.datasette.io/en/stable/changelog.html#v0-64-3), but failed in the Datasette 1.0 alphas. Here's the [issue describing the problem](https://github.com/simonw/datasette-export-notebook/issues/17).
None
TIL Using llama-cpp-python grammars to generate JSON — [llama.cpp](https://github.com/ggerganov/llama.cpp) recently added the ability to control the output of any model using a grammar.
None
TIL Trying out cr-sqlite on macOS — [cr-sqlite](https://github.com/vlcn-io/cr-sqlite) is fascinating. It's a loadable SQLite extension by Matt Wonlaw that "allows merging different SQLite databases together that have taken independent writes".
None
TIL Summarizing Hacker News discussion themes with Claude and LLM — I've been experimenting with the combination of [Claude](https://claude.ai/) and my [LLM CLI tool](https://llm.datasette.io/) to give me quick summaries of long discussions on [Hacker News](https://news.ycombinator.com/).
None
TIL Embedding paragraphs from my blog with E5-large-v2 — Xeophon [suggested](https://twitter.com/TheXeophon/status/1700203810545680542) that [E5-large-v2](https://huggingface.co/intfloat/e5-large-v2) as an embedding model that was worth a closer look.
None
TIL Running Datasette on Hugging Face Spaces — [Julien Chaumond](https://twitter.com/julien_c/status/1700142113713758438), this morning (replying to my tweet about [my Hugging Face TheBloke model git scraper](https://twitter.com/simonw/status/1700130557638869140)):
None
TIL Remember to commit when using datasette.execute_write_fn() — I was writing some code for [datasette-auth-tokens](https://github.com/simonw/datasette-auth-tokens) that used [db.execute_write_fn()](https://docs.datasette.io/en/stable/internals.html#await-db-execute-write-fn-fn-block-true) like this:
None
TIL Streaming output of an indented JSON array — For [paginate-json]() I wanted to implement streaming output of an indented JSON array to my terminal.
None
TIL Downloading partial YouTube videos with ffmpeg — I spoke [at WordCamp US 2023](), and wanted to grab a copy of the video of my talk. I always try to keep my own copies of these because I've seen some conferences eventually take these offline in the past.
None
TIL Compile and run a new SQLite version with the existing sqlite3 Python library on macOS — I've been trying to figure this out for years. Previous notes include [Using LD_PRELOAD to run any version of SQLite with Python](https://til.simonwillison.net/sqlite/ld-preload) (Linux only), and [Building a specific version of SQLite with pysqlite on macOS/Linux](https://til.simonwillison.net/sqlite/build-specific-sqlite-pysqlite-macos) and [Using pysqlite3 on macOS](https://til.simonwillison.net/sqlite/pysqlite3-on-macos) (both using the `pysqlite3` package).
None