Notes on software engineering

Archive / page 7

121–140 of 546 posts, newest first.

  1. 2025
  2. Paginating through the GitHub GraphQL API with Python

    For my auto-updating personal README I needed to fetch the latest release for every repository I have on GitHub. Since I have 316 public repos I wanted the most efficent way possible to do this.

    1 min read
  3. Embedding paragraphs from my blog with E5-large-v2

    Xeophon suggested that E5-large-v2 as an embedding model that was worth a closer look. It's an interesting model. It's trained to match queries against passages of text.

    6 min read
  4. Pausing traffic and retrying in Caddy

    A pattern I really like for zero-downtime deploys is the ability to "pause" HTTP traffic at the load balancer, such that incoming requests from browsers appear to take a few extra seconds to return…

    2 min read
  5. Syntax highlighting Python console examples with GFM

    It turns out GitHub Flavored Markdown can apply syntax highlighting to Python console examples, like this one: The trick is to use the following: pycon import csv with open('eggs.csv', newline='') as…

    1 min read
  6. Extracting web page content using Readability.js and shot-scraper

    Readability.js is "A standalone version of the readability library used for Firefox Reader View". I figured out how to use the two of these together to extract the core content from a web page using…

    1 min read
  7. impaste: pasting images to piped commands on macOS

    I wanted the ability to paste the image on my clipboard into a command in the macOS terminal. It turns out only works with textual data - so copying a portion of a screenshot to my clipboard (using…

    1 min read
  8. Trying out Quarto on macOS

    I decided to try out Quarto, the new notebook/markdown/publishing system built on Pandoc. I followed their Get started guide and downloaded and installed the macOS installer.

    1 min read
  9. Turning on Jinja autoescaping when using Template() directly

    Jinja autoescaping is turned off by default. Coming from Django this frequently catches me out. You can turn on autoescaping for your Jinja environment using: But what about if you are using directly?

    1 min read
  10. Running Python code in a Pyodide sandbox via Deno

    I continue to seek a solution to the Python sandbox problem. I want to run an untrusted piece of Python code in a sandbox, with limits on memory and time.

    2 min read
  11. How to mock httpx using pytest-mock

    I wrote this test to exercise some httpx code today, using pytest-mock. The key was to use which patches the module that was imported by the module.

    1 min read
  12. Run Python code in a WebAssembly sandbox

    I've been trying to figure this out for ages. Tim Bart responded to my call for help on Hacker News with this extremely useful code example showing how to run Python code in WebAssembly inside Python…

    1 min read
  13. Trying out the facebook/musicgen-small sound generation model

    Facebook's musicgen is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.

    1 min read
  14. Trying out the facebook/musicgen-small sound generation model

    Facebook's musicgen is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.

    1 min read
  15. Using the Fly Docker registry

    Fly.io lets you deploy Docker containers that will be compiled as a Firecracker VM and run in locations around the world. Fly offer a number of ways to build and deploy apps.

    2 min read
  16. A simple two column CSS grid

    I decided to use CSS grids for this. I started with GPT-4. My prompt: HTML and CSS to display a grid of four images, each with a paragraph caption below the image - use figcaption The 2x2 grid should…

    2 min read
  17. Closest locations to a point

    Here's a PostgreSQL SQL query that returns the closest locations to a point, based on a brute-force approach where the database calculates the distance (in miles) to every single row and then sorts by…

    1 min read
  18. Learn Data Engineering topics using Flash Cards

    Flash cards are amazing way to learn advanced topics. Spaced repetition techniques are quite powerful and play well with how our brains work.

    1 min read
  19. Syncing slide images and audio in iMovie

    I found an MP3 recording of an old talk I gave and decided to use the slides from that talk to create a video using iMovie.

    1 min read
  20. Using cog to update --help in a Markdown README file

    My csvs-to-sqlite README includes a section that shows the output of the command (relevant issue). I had been manually copying this in, but I decided to try using cog to automate the process.

    1 min read
  21. Convert git log output to JSON using jq

    I just spent way too long messing around with ChatGPT (transcript here) trying to figure this out. After much iteration, here's a recipe that works (mostly written by me at this point): The output…

    1 min read