til

320 posts tagged “til”.

  1. 2024
  2. WebAuthn browser support

    I started exploring WebAuthn today - a set of browser standards that adds support for both Yubikey 2FA hardware devices and "platform" authentication using things like Touch ID and Face ID.

    1 min read
  3. Run pytest against a specific Python version using Docker

    For datasette issue 1802 I needed to run my test suite using a specific version of Python 3.7. I decided to do this using Docker, using the official python:3.7-buster image.

    1 min read
  4. Skipping a GitHub Actions step without failing

    I wanted to have a GitHub Action step run that might fail, but if it failed the rest of the steps should still execute and the overall run should be treated as a success.

    1 min read
  5. Transcribing MP3s with whisper-cpp on macOS

    I asked on Twitter for tips about running Whisper transcriptions in the CLI on my Mac. Werner Robitza pointed me to Homebrew's whisper-cpp formula, and when I complained that it didn't have quite…

    1 min read
  6. Using a Tailscale exit node with GitHub Actions

    For an (ethical) scraping project I found that my low-volume scraper was working from my laptop but was being blocked by Cloudflare when I attempted to run it in GitHub Actions, presumably because the…

    3 min read
  7. Using unnest() to use a comma-separated string as the input to an IN query

    django-sql-dashboard lets you define a SQL query plus one or more text inputs that the user can provide in order to execute the query.

    1 min read
  8. 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
  9. 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
  10. 2023
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  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. 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
  20. 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
  21. 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
  22. 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