Notes on software engineering

Archive / page 21

401–420 of 546 posts, newest first.

  1. 2023
  2. Cloudflare redirect rules with dynamic expressions

    I wanted to ensure would redirect to - including any path - using Cloudflare. I've solved this with page rules in the past, but this time I tried using a "redirect rule" instead.

    1 min read
  3. Commit a file if it changed

    This recipe runs a Python script to update a README, then commits it back to the parent repo but only if it has changed: My first attempt threw an error if I tried o run and the README had not…

    1 min read
  4. Only run GitHub Action on push to master / main

    Spotted in this Cloud Run example: Useful if you don't want people opening pull requests against your repo that inadvertantly trigger a deploy action!

    1 min read
  5. Quick and dirty mock testing with mock_calls

    I needed to write a test that checked for a really complex sequence of mock calls for s3-credentials 3.

    1 min read
  6. Running Ethernet over existing coaxial cable

    I recently noticed that the router in our garage was providing around 900 Mbps if I plugged my laptop directly into it via an Ethernet cable, but that speed fell to around 80Mbps (less than 1/10th…

    2 min read
  7. Using Playwright MCP with Claude Code

    Short version: run this before starting : That's it! Now when you run Playwright will be available. You can say things like: And a visible Chrome browser window, controlled by Claude Code, will open…

    1 min read
  8. Scroll page to form if there are errors

    For a Django application I'm working on (this issue) I have a form that can be quite a long way down the page.

    1 min read
  9. Styling an HTML dialog modal to take the full height of the viewport

    Today I got Claude to build me an experiment to use it for a side panel that would slide in from the right hand side of the screen, looking like this: But what's with that gap at the bottom?

    3 min read
  10. Writing pytest tests against tools written with argparse

    I usually build command-line tools using Click (and my click-app cookiecutter template), which includes a really nice set of tools for writing tests.

    1 min read
  11. Bulk editing status in GitHub Projects

    GitHub Projects has a mechanism for bulk updating the status of items, but it's pretty difficult to figure out how to do it. The trick is to use copy and paste.

    1 min read
  12. Freezing requirements with pip-tools

    I tried pip-tools for the first time today to pin the requirements for the natbat/pillarpointstewards Django app. The pip-tools README is really good. Here's how I'm using it.

    1 min read
  13. HTML datalist

    A Datasette feature suggestion concerning autocomplete against a list of known values inspired me to learn how to use the HTML element (see MDN).

    1 min read
  14. Running PyPy on macOS using Homebrew

    Towards Inserting One Billion Rows in SQLite Under A Minute includes this snippet: All I had to do was run my existing code, without any change, using PyPy.

    1 min read
  15. Scraping the Sky News Westminster Accounts, a Flourish application

    Sky News in partnership with Tortoise published a fantastic piece of investigative data reporting: the Westminster Accounts, a database of money in UK politics that brought together data from three…

    2 min read
  16. Understanding the CSS auto-resizing textarea trick

    Chris Coyier wrote about the new property, which can get a to automatically expand to fit its content - but currently only in Google Chrome Canary.

    5 min read
  17. Annotated code for a demo of WebSocket chat in Deno Deploy

    Deno Deploy is a hosted Deno service that promises a multi-tenant JavaScript engine running in 25 data centers across the world.

    1 min read
  18. 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
  19. 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
  20. 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
  21. 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