Implementing a "copy to clipboard" button
I had to figure this out while building datasette-copyable - demo here. The trick is to run to copy to the clipboard - but only after first ensuring that some selectable content (probably in a…
Notes on software engineering
281–300 of 546 posts, newest first.
I had to figure this out while building datasette-copyable - demo here. The trick is to run to copy to the clipboard - but only after first ensuring that some selectable content (probably in a…
I had a bug that was only showing up in CI against Python 3.8. I used the following pattern with pyenv to quickly run the tests against that specific version.
I figured out how to use a JSON API to run a very limited Google search today in a legit, non-screen-scraper way.
I wanted to start an actual server process, run it for the duration of my pytest session and shut it down at the end. Here's the recipe I came up with.
Thanks Stuart Langridge for showing me how to do this:
Here's the pattern I figured out for using the openai Python library to extract structured data from text using a single call to the model.
I decided to adopt Prettier as the JavaScript code style for Datasette, based on my success with Black for Python code.
For Datasette 1249 I wanted to build a Docker image from the base image ("buster" is the current stable release of Debian) but include a single package from "sid", the unstable Debian distribution.
I wanted to redirect all traffic to to a different domain - preserving the path and the querystring and serving a 301 status code.
A quick recipe I figured out today, for running the tests for a project against multiple Python versions. The key command option is .
I figured out how to migrate a GitHub wiki (public or private) from one repository to another while preserving all history. The trick is that GitHub wikis are just Git repositories.
A follow-up to Using OpenAI functions and their Python library for data extraction and Using the ChatGPT streaming API from Python.
There's a new version of Vite out (3.0) and I wanted to upgrade my datasette-table package to use it. I mainly followed the guide on Update all the Node.js dependencies to their latest version to work…
I found myself wanting to register more than one instance of a Pluggy plugin hook inside a single module. Hooks are usually registered like this: Where matches the name of a registered plugin hook.
I really like Cog (previously) as a tool for automating aspects of my Python project documentation - things like the SQL schemas shown on the LLM logging page.
Carelessly including the output of in an HTML page can lead to an XSS hole, thanks to the following: Jinja has a function that avoids this in - the (simplified) implementation looks like this: Which…
I live in El Granada, California. Wikipedia calls us a census designated place - we don't have a mayor or city council.
While implementing more finely-grained permissions for (issue 8) I decided I wanted to register a Datasette pluggy plugin for the duration of a single test.
I've been experimenting with the combination of Claude and my LLM CLI tool to give me quick summaries of long discussions on Hacker News.
I had an 11GB movie in Apple Photos (sync'd from my iPhone) and I wanted to upload it to YouTube (actually via AirDrop to another laptop first).