Passing command arguments using heredoc syntax
This trick works for both Bash and zsh. I wanted to pass the following as an argument to the sqlite-utils CLI tool: Problem: this contains both single AND double quotes, which makes string escaping a…
320 posts tagged “til”.
This trick works for both Bash and zsh. I wanted to pass the following as an argument to the sqlite-utils CLI tool: Problem: this contains both single AND double quotes, which makes string escaping a…
I finally found a workaround for this error when attempting to load a SQLite extension in Python on macOS: The fix is to install Python using Homebrew, and then use that version of Python.
JSR is a brand new package repository for "modern JavaScript and TypeScript", launched on March 1st by the Deno team as a new alternative to npm My JavaScript ecosystem fluency isn't great, so it took…
I upgraded my Niche Museums site to use PhotoSwipe for its photo galleries today. Here's my issue. This lead me down a bit of a rabbit hole of photo EXIF data.
in Python is a form of co-operative multitasking, where everything runs in a single thread but asynchronous tasks can yield to other tasks to allow them to execute.
I usually use Squoosh.app to reduce the size of my PNGs, but in this case I had a folder with nearly 50 images in it so I wanted to do it using the command-line.
I figured out how to use the Chrome DevTools to execute JavaScript interactively inside the Electron main process.
While trying to use pysqlite3 on macOS I got the following error: Thanks to this tip on Stack Overflow I found that installing a fresh SQLite with and then running the following first fixed the error…
I needed to tell both and to ignore the same line of code. This worked: The order here mattered. This did not get picked up by both tools: noqa: F401 type: ignore But this did: type: ignore noqa: F401
I had a Django project that used (in particular a ) to manage dependencies and I wanted to build a Docker container for it.
My db-to-sqlite tool can connect to a PostgreSQL database, export all of the content and write it to a SQLite database file on disk.
I figured out this pattern today for testing an HTML table dynamically added to a page by JavaScript, using Playwright Python: there is a fixture that starts Datasette running on a local port and…
For photos-to-sqlite I needed to install as a dependency, but only if the platform is macOS - it's not available for Linux. Here's the magic incantation to do that: So in the install requires line.
nanoGPT is Andrej Karpathy's "simplest, fastest repository for training/finetuning medium-sized GPTs".
I wanted to run some Django tests - using and with Django configured to pick up the environment variable via dj-database-url - against a PostgreSQL server running in GitHub Actions.
A few years ago I decided to learn how to make some classic cocktails. It is a very rewarding hobby. Of all of the drinks that I have learned to make, by far the biggest crowd pleaser is the Tommy's…
I ran into a tricky problem while working on this issue: the following line was behaving in an unexpected way for me: datasette content.db .db –create What I expect this to do is to create a database…
When I'm working with Python I like four space indents, but for JavaScript or HTML I like two space indents. Today I figured out how to teach VS Code those defaults. 1.
I needed to write a relatively repetitive collection of tests, for a number of different possible error states.
I'm still working towards adding multi-modal support to my LLM tool. In the meantime, here are notes on running prompts against images and PDFs and audio and video files from the command-line using…