Notes on software engineering

Archive / page 17

321–340 of 546 posts, newest first.

  1. 2024
  2. Using the undocumented Fly GraphQL API

    Fly has a GraphQL API which is used by some of their own tools - I found it while browsing around their code on GitHub.

    1 min read
  3. sips: Scriptable image processing system

    I wanted to convert some images to on my Mac. I asked ChatGPT: On MacOS use CLI to convert webp images to PNG And it told me about : sips -s format png image.webp –out image.png Or to run it against…

    1 min read
  4. Controlling the style of dumped YAML using PyYAML

    I had a list of Python dictionaries I wanted to output as YAML, but I wanted to control the style of the output.

    1 min read
  5. Piping echo to a file owned by root using sudo and tee

    I wanted to create a file with a shell one-liner where the file lived somewhere owned by root. I tried this but it didn't work: Running using didn't pass through to the bit.

    1 min read
  6. Publish releases to PyPI from GitHub Actions without a password or token

    I published a package to PyPI today using their Trusted Publishers mechanism for the first time. Trusted Publishers provides a mechanism for configuring PyPI to allow a specific GitHub Actions…

    4 min read
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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: I wanted to get back a bigger version of that image.

    1 min read
  18. 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
  19. 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
  20. 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
  21. 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): The Python standard library calendar module has a utility function that really helps here: Outputs:

    1 min read