Notes on software engineering

Archive / page 25

481–500 of 547 posts, newest first.

  1. 2023
  2. Consecutive groups in SQL using window functions

    I have a database table with all of my Swarm checkins since 2011, created using my swarm-to-sqlite tool.

    3 min read
  3. Finding the largest SQLite files on a Mac

    This runs using Spotlight so it's really fast: mdfind "kMDItemDisplayName == .sqlite" -0 xargs -0 stat "-f%z %N" sort -nr head -n 20 I have a lot of files in my Dropbox so I excluded those like this…

    1 min read
  4. Relinquishing control in Python asyncio

    in Python is a form of co-operative multitasking, where everything runs in a single thread but asynchronous tasks can yield to other tasks to allow them to execute.

    1 min read
  5. Generating documentation from tests using files-to-prompt and LLM

    I was experimenting with wasmtime-py today and found the current documentation didn't quite give me the information that I needed.

    2 min read
  6. Generating URLs to a Gmail compose window

    I wanted to send out a small batch of follow-up emails for workshop attendees today, and I realized that since I have their emails in a database table I might be able to semi-automate the process.

    2 min read
  7. Shrinking PNG files with pngquant and oxipng

    I usually use Squoosh.app to reduce the size of my PNGs, but in this case I had a folder with nearly 50 images in it so I wanted to do it using the command-line.

    1 min read
  8. Downloading every video for a TikTok account

    TikTok may or may not be banned in the USA within the next 24 hours or so. Here's a pattern you can use to download all of the videos from a specific account.

    2 min read
  9. Using the Chrome DevTools console as a REPL for an Electron app

    I figured out how to use the Chrome DevTools to execute JavaScript interactively inside the Electron main process.

    1 min read
  10. Using pysqlite3 on macOS

    While trying to use pysqlite3 on macOS I got the following error: Thanks to this tip on Stack Overflow I found that installing a fresh SQLite with and then running the following first fixed the error…

    1 min read
  11. Ignoring a line in both flake8 and mypy

    I needed to tell both and to ignore the same line of code. This worked: The order here mattered. This did not get picked up by both tools: noqa: F401 type: ignore But this did: type: ignore noqa: F401

    1 min read
  12. Annotated package.json for idb-keyval

    Jake Archibald pointed to his for as a "modernish example" of NPM packaging on Twitter this morning. I've been frustrated at my lack of understanding of for too long, so I decided to do some research…

    1 min read
  13. How to call pip programatically from Python

    I needed this for the and commands, see issue 925. My initial attempt at this resulted in weird testing errors ( 928) - while investigating them I stumbled across this comment in the source code: So I…

    1 min read
  14. Using pipenv and Docker

    I had a Django project that used (in particular a ) to manage dependencies and I wanted to build a Docker container for it.

    1 min read
  15. Driving an external display from a Mac laptop

    For a friend's wedding I needed to run a Google Photos slideshow on some large televisions. I had two MacBook Pro laptops. Here's how I got it to work.

    1 min read
  16. Helper function for pagination using AWS boto3

    I noticed that a lot of my boto3 code in s3-credentials looked like this: This was enough verbosity that I was hesitating on implementing pagination properly for some method calls.

    1 min read
  17. Programatically accessing Heroku PostgreSQL from GitHub Actions

    My db-to-sqlite tool can connect to a PostgreSQL database, export all of the content and write it to a SQLite database file on disk.

    1 min read
  18. Testing HTML tables with Playwright Python

    I figured out this pattern today for testing an HTML table dynamically added to a page by JavaScript, using Playwright Python: there is a fixture that starts Datasette running on a local port and…

    1 min read
  19. GitHub Actions job summaries

    New feature announced here. Here's the full documentation. These are incredibly easy to use. GitHub creates a file in your workspace and puts the filename in , so you can build the summary markdown…

    1 min read
  20. Use setup.py to install platform-specific dependencies

    For photos-to-sqlite I needed to install as a dependency, but only if the platform is macOS - it's not available for Linux. Here's the magic incantation to do that: So in the install requires line.

    1 min read
  21. Cryptography in Pyodide

    Today I was evaluating if the Python cryptography package was a sensible depedency for one of my projects.

    2 min read