til

320 posts tagged “til”.

  1. 2024
  2. Redirecting all paths on a Vercel instance

    I wanted to redirect all traffic to to a different domain - preserving the path and the querystring and serving a 301 status code.

    1 min read
  3. Testing different Python versions with uv with-editable and uv-test

    A quick recipe I figured out today, for running the tests for a project against multiple Python versions. The key command option is .

    1 min read
  4. Migrating a GitHub wiki from one repository to another

    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.

    1 min read
  5. Processing a stream of chunks of JSON with ijson

    A follow-up to Using OpenAI functions and their Python library for data extraction and Using the ChatGPT streaming API from Python.

    1 min read
  6. Upgrading packages with npm

    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…

    1 min read
  7. Registering the same Pluggy hook multiple times in a single file

    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.

    1 min read
  8. Running cog automatically against GitHub pull requests

    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.

    1 min read
  9. Safely outputting JSON

    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…

    1 min read
  10. Livestreaming a community election event on YouTube

    I live in El Granada, California. Wikipedia calls us a census designated place - we don't have a mayor or city council.

    4 min read
  11. Registering temporary pluggy plugins inside tests

    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.

    1 min read
  12. Summarizing Hacker News discussion themes with Claude and LLM

    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.

    8 min read
  13. Trick Apple Photos into letting you access your video files

    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).

    1 min read
  14. Useful Markdown extensions in Python

    I wanted to render some markdown in Python but with the following extra features: - URLize any bare URLs in the content, like GFM - Handle python from mdx urlize import UrlizeExtension import markdown…

    1 min read
  15. Named Entity Resolution with dslim/distilbert-NER

    I was exploring the original BERT model from 2018, which is mainly useful if you fine-tune a model on top of it for a specific task. dslim/distilbert-NER by David S.

    1 min read
  16. Setting cache-control: max-age=31536000 with a Cloudflare Transform Rule

    I serve static assets for my blog (mainly images) from , which is an AWS S3 bucket served via Cloudflare.

    1 min read
  17. The pdb interact command

    Today Carlton told me about the interact command in the Python debugger. Here's how to use it with (but it works anywhere else where you find yourself in a session).

    1 min read
  18. Using ChatGPT to write AppleScript

    I found a killer application for ChatGPT today: writing AppleScript! I've been stubbornly refusing to learn AppleScript for nearly twenty years at this point.

    1 min read
  19. Restricting SSH connections to devices within a Tailscale network

    I'm running an AWS Lightsail instance and I want to only be able to SSH to it from devices connected to my Tailscale network.

    1 min read
  20. Using grep to write tests in CI

    GitHub Actions workflows fail if any of the steps executes something that returns a non-zero exit code. Today I learned that returns a non-zero exit code if it fails to find any matches.

    1 min read
  21. Sort by number of JSON intersections

    This post on Reddit asked how to run a query that takes a list of items (in this case ingredients) as the input and returns all rows with at least one of those items in a JSON list, ordered by the…

    1 min read