til

320 posts tagged “til”.

  1. 2025
  2. SQLite pragma_function_list()

    The SQLite table-valued function returns a list of functions that have been registered with SQLite, including functions that were added by extensions. Here's how to interpret its output.

    3 min read
  3. Vega-Lite bar charts in the same order as the data

    I've been puzzling over this one for a couple of years now, and I finally figured out the solution. The Vega-Lite charting library can generate bar charts using a JSON definition that looks like this…

    1 min read
  4. Introspecting Python function parameters

    For https://github.com/simonw/datasette/issues/581 I want to be able to inspect a Python function to determine which named parameters it accepts and send only those arguments.

    1 min read
  5. Recovering data from AWS Lightsail using EC2

    I ran into problems with my AWS Lightsail instance: it exceeded the CPU burst quota for too long and was suspended, and I couldn't figure out how to un-suspend it.

    2 min read
  6. Testing things in Fedora using Docker

    I attempted to replicate the bug in a Fedora container using Docker, by running this command: This downloaded the official image and dropped me into a Bash shell.

    1 min read
  7. 2024
  8. Querying the GitHub archive with the ClickHouse playground

    Via this comment on Hacker News I started exploring the ClickHouse Playground. It's really cool, and among other things it allows CORS-enabled API hits that can query a decade of history from the…

    2 min read
  9. Running multiple servers in a single Bash script

    I spotted this script that starts the opendream appication running both a Python server and a script and it intrigued me - was it this easy to have a single Bash script run two servers?

    1 min read
  10. Signing and notarizing an Electron app for distribution using GitHub Actions

    I had to figure this out for Datasette Desktop. Pay for an Apple Developer account First step is to pay $99/year for an Apple Developer account.

    4 min read
  11. Using build-arg variables with Cloud Run deployments

    For datasette/issues/1522 I wanted to use a Docker build argument in a that would then be deployed to Cloud Run. I needed this to be able to control the version of Datasette that was deployed.

    1 min read
  12. Treating warnings as errors in pytest

    I was seeing this warning in a Django project when I thought I was correctly using timezone-aware dates everywhere: RuntimeWarning: DateTimeField Shift.shift start received a naive datetime…

    1 min read
  13. Using jq in an Observable notebook

    I use the language quite a lot these days, mainly because I can get ChatGPT to write little JSON transformation programs for me very quickly. I just figured out how to run in an Observable notebook.

    1 min read
  14. SQLite triggers

    I wrote a Python script, triggers.py, to help me understand what data is available to SQLite triggers for which operations. SQLite triggers are documented here.

    1 min read
  15. Storing and serving related documents with openai-to-sqlite and embeddings

    I decide to upgrade the related articles feature on my TILs site. Previously I calculated these using full-text search, but I wanted to try out a new trick using OpenAI embeddings for document…

    5 min read
  16. mlc-chat - RedPajama-INCITE-Chat-3B on macOS

    MLC (Machine Learning Compilation) on May 22nd 2023: Bringing Open Large Language Models to Consumer Devices RedPajama on Apple Silicon is achieved by compiling the LLM using Metal for M1/M2 GPUs The…

    1 min read
  17. Upgrade Postgres.app on macOS

    I've been using Postgres.app to run PostgreSQL on my Mac for years. I like that it's easy to install, gives me a task tray icon to control it and means I don't have to run a full Docker environment…

    1 min read
  18. Using Jest without a package.json

    I wanted to try out Jest for writing JavaScript unit tests, in a project that wasn't set up with and other NPM related things. Jest looks for tests in a directory.

    1 min read
  19. Looping over comma-separated values in Bash

    Given a file (or a process) that produces comma separated values, here's how to split those into separate variables and use them in a bash script.

    1 min read
  20. Pisco sour

    This classic Peruvian cocktail recipe is particularly useful if you have both a lemon tree and chickens producing fresh eggs! Here's the recipe I've landed on, after some experimentation.

    1 min read
  21. Search and replace with regular expressions in VS Code

    I wanted to replace all instances of this: With this: :issue: For sqlite-utils issue 306. I used the VS Code's Find and Replace tool with regular expression mode turned on (the button).

    1 min read
  22. migrations.RunSQL.noop for reversible SQL migrations

    provides an easy way to create "reversible" Django SQL migrations, where the reverse operation does nothing (but keeps it possible to reverse back to a previous migration state without being blocked…

    1 min read