Notes on software engineering

Archive / page 20

381–400 of 546 posts, newest first.

  1. 2024
  2. Workaround for google-github-actions/setup-gcloud errors

    I used the google-github-actions/setup-gcloud action in all of my GitHub Actions workflows that deploy applications to Cloud Run.

    1 min read
  3. Configuring Dependabot for a Python project

    GitHub's Dependabot can automatically file PRs with bumps to dependencies when new versions of them are available.

    1 min read
  4. The SQLite now argument is stable within the same query

    I stumbled across an interesting little detail of SQLite today, running the following query: That pattern is described here and in this TIL, it returns the current Unix timestamp in milliseconds.

    1 min read
  5. 2023
  6. Display EC2 instance costs per month

    The EC2 pricing page shows cost per hour, which is pretty much useless. I want cost per month. The following JavaScript, pasted into the browser developer console, modifies the page to show…

    1 min read
  7. Formatting thousands in Jinja

    Here's how to format a number in Jinja with commas for thousands, without needing any custom filters or template functions: {{ "{:,}".format(row count) }} Output looks like this: 179,119 Bonus: here's…

    1 min read
  8. Using namedtuple for pytest parameterized tests

    I'm writing some quite complex pytest parameterized tests this morning, and I was finding it a little bit hard to read the test cases as the number of parameters grew.

    1 min read
  9. Packaging a Python app as a standalone binary with PyInstaller

    PyInstaller can take a Python script and bundle it up as a standalone executable for macOS, Linux and apparently Windows too (I've not tried it on Windows yet).

    1 min read
  10. Constructing GeoJSON in PostgreSQL

    In order to efficiently generate a GeoJSON representation of a vast number of locations, I'm currently experimenting with generating the GeoJSON directly inside a PostgreSQL SQL query using and…

    1 min read
  11. Providing a "subscribe in Google Calendar" link for an ics feed

    If you provide your own custom generated ICS file hosted at a URL it's nice to be able to give Google Calendar users an easy way to subscribe to that feed.

    1 min read
  12. Compile a new sqlite3 binary on Ubuntu

    I wanted to try the backup command that was released in SQLite3 3.27.0 on 2019-02-07. Ubuntu 18.04.4 LTS has SQLite 3.22.0 from 2018-01-22.

    1 min read
  13. The Wikipedia page stats API

    Via https://alexgarcia.xyz/dataflow/examples/wiki-pageviews/ I found this API for retrieving daily pageview stats from Wikipedia for any article: - https://wikimedia.org/api/rest…

    1 min read
  14. Read the Docs Search API

    I stumbled across this API today: https://docs.datasette.io/ /api/v2/docsearch/?q=startup&project=datasette&version=stable&language=en It's used by the search feature at…

    1 min read
  15. Reporting bugs in GitHub to GitHub

    I found out today (via this post) about a dedicated interface for reporting bugs in GitHub to GitHub: https://support.github.com/contact/bug-report It includes full markdown support, which means you…

    1 min read
  16. Splitting on commas in SQLite

    I had an input string in format and I needed to split it into three separate values in SQLite. I managed to do it using a confusing combination of the and functions.

    1 min read
  17. Athena error: The specified key does not exist

    I was trying to run Athena queries against compressed JSON log files stored in an S3 bucket. No matter what I tried, I got the following error: The specified key does not exist.

    1 min read
  18. Using curl to run GraphQL queries from the command line

    I wanted to run a query against the GitHub GraphQL API using on the command line, while keeping the query itself as readable as possible.

    2 min read
  19. Atuin for zsh shell history in SQLite

    Atuin (via Rhet Turnbull) "replaces your existing shell history with a SQLite database". Obviously I had to try this out!

    1 min read
  20. Installing Python on macOS with the official Python installer

    I usually use Homebrew on macOS, but I decided to try using the official Python installer based on this Twitter conversation.

    1 min read
  21. Testing the Access-Control-Max-Age CORS header

    Today I noticed that Datasette wasn't serving a header. This meant that any CORS pre-flight requests would be repeated for every request, which hurts performance - the browser should be able to cache…

    1 min read
  22. Writing an Azure Function that serves all traffic to a subdomain

    Azure Functions default to serving traffic from a path like - for example . If you want to serve an entire website through a single function (e.g.

    1 min read