Notes on software engineering

Archive / page 22

421–440 of 550 posts, newest first.

  1. 2023
  2. Track timestamped changes to a SQLite table using triggers

    This is more of a "today I figured out" than a TIL. I have an idea to implement the Denormalized Query Engine design pattern using SQLite triggers.

    1 min read
  3. Compile and run a new SQLite version with the existing sqlite3 Python library on macOS

    I've been trying to figure this out for years. Previous notes include Using LD PRELOAD to run any version of SQLite with Python (Linux only), and Building a specific version of SQLite with pysqlite on…

    1 min read
  4. GitHub OAuth for a static site using Cloudflare Workers

    My tools.simonwillison.net site is a growing collection of small HTML and JavaScript applications hosted as static files on GitHub Pages.

    6 min read
  5. Rewriting a Git repo to remove secrets from the history

    I decided to make a GitHub repository public today that had previously been private. Unfortunately the revision history of that repository included some secret values, one of which I could not figure…

    1 min read
  6. Search across all loaded resources in Firefox

    You can search for a string in any resource loaded by a page (including across HTML, JavaScript and CSS) in the Debugger pane by hitting Command+Shift+F.

    1 min read
  7. Using Fabric with an SSH public key

    Inspired by this tweet by Mike Driscoll I decided to try using Fabric to run commands over SSH from a Python script, using a public key for authentication.

    1 min read
  8. Compiling the SQLite spellfix.c module on macOS

    I wanted to browse a backup copy of my Plex database, which is a SQLite file. I tried this: The module is an optional module for SQLite.

    1 min read
  9. Enabling a gin index for faster LIKE queries

    I tried using a gin index to speed up queries against a column. PostgreSQL: More performance for LIKE and ILIKE statements provided useful background.

    1 min read
  10. Scroll to text fragments

    I ran a Google search this morning for and when I clicked on the top result it jumped me to a highlighted snippet of text on the page, despite that page not having relevant anchor links.

    1 min read
  11. Planning parallel downloads with TopologicalSorter

    For complicated reasons I found myself wanting to write Python code to resolve a graph of dependencies and produce a plan for efficiently executing them, in parallel where possible.

    1 min read
  12. Finding uses of an API with the new GitHub Code Search

    The GitHub Code Search beta is really powerful - it allows advanced search - including regular expression matches - against every public repo on GitHub.

    1 min read
  13. literalinclude with markers for showing code in documentation

    I wanted to include some example Python tests in the Datasette documentation - but since they were tests, I also wanted to execute them as part of my test suite to make sure they worked correctly.

    1 min read
  14. Understanding Kristofer Joseph's Single File Web Component

    Via Brian LeRoux I found single-file-web-component.html by Kristofer Joseph. It's really clever! It demonstrates how to build a custom Web Component in a single HTML file, using some neat tricks.

    1 min read
  15. Searching for repositories by topic using the GitHub GraphQL API

    I wanted to use the GitHub GraphQL API to return all of the repositories on the https://github.com/topics/git-scraping page.

    1 min read
  16. Annotated explanation of David Beazley's dataklasses

    David Beazley on Twitter: So, I just published this deliciously evil spin on dataclasses. It's tiny and the resulting classes import about 15-20 faster than dataclasses.

    1 min read
  17. Basic strace to see what a process is doing

    I had a long-running process and I wanted to check that it was at least doing something . I know its PID (32425 in this case) - here's how to use to see what it's doing right now.

    1 min read
  18. List all columns in a SQLite database

    Here's a devious trick for listing ALL columns in a SQLite database, using a SQL query that generates another SQL query.

    4 min read
  19. Null case comparisons in SQLite

    I wanted to say "output this transformed value if it's not null, otherwise nothing". The recipe I figured out was: Full query example: This uses datasette-rure for the function.

    1 min read
  20. Storing files in an S3 bucket between GitHub Actions runs

    For my git-history live demos I needed to store quite large files ( 200MB SQLite databases) in between GitHub Actions runs, to avoid having to recreate the entire file from scratch every time.

    1 min read
  21. Copy tables between SQLite databases

    I figured out a pattern for doing this today using the CLI tool - given two SQLite databases in the current folder, called and : I'm using that in this GitHub Actions workflow.

    1 min read