til

320 posts tagged “til”.

  1. 2024
  2. Installing tools written in Go

    Today I learned how to install tools from GitHub that are written in Go, using github.com/icholy/semgrepx as an example: go install github.com/icholy/semgrepx@latest Running this command grabs a copy…

    1 min read
  3. Rewriting a repo to contain the history of just specific files

    I wanted to start a new git repository containing just the history of two specific files from my help-scraper repository.

    1 min read
  4. Upgrading a pipx application to an alpha version

    I wanted to upgrade my git-history installation to a new alpha version. doesn't work for that, because it upgrades to the most recent stable version - but I wanted the alpha.

    1 min read
  5. Using SQL with GDAL

    Inspired by Brad Neuberg I decided to take a look at the SQL features in the GDAL family of tools. GDAL is a complex beast.

    3 min read
  6. Running pytest against a specific Python version with uv run

    While working on this issue I figured out a neat pattern for running the tests for my project locally against a specific Python version using uv run: The new-to-me trick here is that works for adding…

    1 min read
  7. Streaming indented output of a JSON array

    I wanted to produce the following output from a command-line tool: But I wanted to do it from a streaming iterator - without first buffering the entire output in an in-memory Python list and calling…

    1 min read
  8. Reusing an existing Click tool with register_commands

    The register commands plugin hook lets you add extra sub-commands to the CLI tool. I have a lot of existing tools that I'd like to also make available as plugins.

    1 min read
  9. Running a gpt-oss eval suite against LM Studio on a Mac

    OpenAI's gpt-oss models come with an eval suite, which is described in their Verifying gpt-oss implementations cookbook.

    5 min read
  10. Saving an in-memory SQLite database to a file in Python

    I was messing around in Python with an in-memory SQLite database, when I decided I actually wanted to save my experimental database to a file so I could explore it using Datasette.

    1 min read
  11. Using awk to add a prefix

    I wanted to dynamically run the following command against all files in a directory: I can't use here because I need each file to be processed using the option. I found a solution using .

    1 min read
  12. Skipping CSV rows with odd numbers of quotes using ripgrep

    I'm working with several huge CSV files - over 5 million rows total - and I ran into a problem: it turned out there were a few lines in those files that imported incorrectly because they were not…

    1 min read
  13. Start, test, then stop a localhost web server in a Bash script

    I wanted to write a bash script that would start a Datasette server running, run a request against it using , then stop the server again.

    2 min read
  14. Loading radio.garden into SQLite using jq

    http://radio.garden/ is an amazing website which displays a 3D globe covered in radio stations and lets you listen to any of them. I wanted to have a play around with their data.

    1 min read
  15. Switching between gcloud accounts

    I have two different Google Cloud accounts active at the moment. Here's how to list them with : And to switch between them with :

    1 min read
  16. Writing Fly logs to S3

    Fly offers fly-log-shipper as a container you can run in a Fly application to send all of the logs from your other applications to a logging provider. Several providers are supported.

    1 min read
  17. __init_subclass__

    David Beazley on Twitter said: I think 95% of the problems once solved by a metaclass can be solved by instead This inspired me to finally learn how to use it!

    1 min read
  18. Social media cards generated with shot-scraper

    My TIL website has social media card images to make links shared from it look slightly more interesting when shared on sites like Mastodon and Twitter.

    3 min read
  19. The simplest recursive CTE

    I found this really simple recursive CTE useful for ensuring I understood how to write recursive CTEs. This query returns five rows from a single column - from 0 to 4.

    1 min read
  20. Making HTTP calls using IPv6

    Tiny TIL today: I learned how to make an HTTP call to an IPv6 address. The trick is to enclose the address in the URL in square braces: http:// 2a09:8280:1::1:2741 Here's that working as a request to…

    1 min read
  21. Updating stable docs in ReadTheDocs without pushing a release

    I use ReadTheDocs for several of my projects. It's fantastic: among other things, it makes it easy to publish the documentation for my latest branch at and the documentation for my latest release at…

    7 min read