Notes on software engineering

Archive / page 17

321–340 of 541 posts, newest first.

  1. SQLite aggregate filter clauses

    SQLite supports aggregate filter clauses (as of 3.30.0, released 2019-10-04), as described in this SQL Pivot in all databases tutorial.

    1 min read
  2. Turning an array of arrays into objects with jq

    Input: I want an array of objects. Here's what I came up with, using jqplay.org: This outputs: If you remove the outer and and use the "Compact output" option you get back this instead:

    1 min read
  3. Assistance with release notes using GitHub Issues

    I like to write the release notes for my projects by hand, but sometimes it can be useful to have some help along the way. Today I figured out this recipe.

    2 min read
  4. JSON Pointer

    I'm looking at options for representing JSON validation errors in more JSON. The recent RFC 7807: Problem Details for HTTP APIs looks relevant here.

    1 min read
  5. Listen to a web page in Mobile Safari

    I found a better way to listen to a whole web page through text-to-speech on Mobile Safari today. Previously I'd been selecting all text on the page manually (an arduous task) and using the "Speak"…

    1 min read
  6. Running different steps on a schedule

    Say you have a workflow that runs hourly, but once a day you want the workflow to run slightly differently - without duplicating the entire workflow. Thanks to @BrightRan, here's the solution.

    1 min read
  7. Summing columns in remote Parquet files using DuckDB

    vivym/midjourney-messages on Hugging Face is a large ( 8GB) dataset consisting of 55,082,563 Midjourney images - each one with the prompt and a URL to the image hosted on Discord.

    4 min read
  8. TOML in Python

    I finally got around to fully learning TOML. Some notes, including how to read and write it from Python. The data structure A TOML file is a document that contains a dictionary of key value pairs.

    2 min read
  9. Running pip install '.[docs]' on ReadTheDocs

    I decided to use ReadTheDocs for my in-development datasette-enrichments project. Previously when I've used ReadTheDocs I've had a folder in my project with its own file containing the requirements.

    1 min read
  10. Show files opened by pytest tests

    My test suite for Datasette has grown so large that running the whole thing sometimes causes me to run out of file handles.

    1 min read
  11. Guessing Amazon image URLs using GitHub Copilot

    I was experimenting with the new Readwise export API and it gave me back the following JSON: The image URL produced a tiny little image - this one: <img alt="A tiny picture of a book cover"…

    1 min read
  12. Simplest possible OAuth authentication with Auth0

    Auth0 provides an authentication API which you can use to avoid having to deal with user accounts in your own web application.

    2 min read
  13. Set a GIF to loop using ImageMagick

    I managed to accidentally create a GIF that ran once without looping. I think this is because I created it in LICEcap but then deleted some frames and re-saved it using macOS Preview.

    1 min read
  14. Close terminal window on Ctrl+D for macOS

    I always forget how to set this up. It's hidden in Preferences - Profiles - Basic - Shell:

    1 min read
  15. Generating a calendar week grid with the Python Calendar module

    I needed to generate a grid calendar that looks like this (design by Natalie Downe): <img alt="A calendar grid showing April with rows for each week, starting 28th March and finishing 1st May"…

    1 min read
  16. Getting Mastodon running on a custom domain

    This TIL is mainly a rehash of these two articles by Jacob and Andrew: - Setting up a personal Fediverse ID / Mastodon instance - Jacob Kaplan-Moss - The Fediverse, And Custom Domains - Andrew Godwin…

    2 min read
  17. Piping from rg to llm to answer questions about code

    Here's a trick I've used a couple of times in the past few days. If I have a question about a codebase and I want to answer it using an LLM, I'll use (aka ) to search that codebase for a specific…

    4 min read
  18. Creating desktop backgrounds using Midjourney

    I decided to create a new desktop background for my Mac using Midjourney. My laptop has a 16:10 aspect ratio and a retina screen, so I wanted as high a resolution image as possible.

    1 min read
  19. Escaping strings in Bash using !:q

    TIL this trick, via Pascal Hirsch on Twitter. Enter a line of Bash starting with a comment, then run on the next line to see what that would be with proper Bash escaping applied.

    1 min read
  20. SQLite can use more than one index for a query

    I was trying to figure out if SQLite has the ability to use more than one index as part of executing a single query, or if it only ever picks a single index that it thinks will give the best…

    1 min read