My Today I Learned snippets. Inspired by jbranchaud/til, which I spotted on Hacker News.
Search these TILs at https://til.simonwillison.net/
84 TILs so far. Atom feed here.- Only run GitHub Action on push to master / main - 2020-04-19
- Dump out all GitHub Actions context - 2020-04-19
- Set environment variables for all steps in a GitHub Action - 2020-04-19
- Commit a file if it changed - 2020-04-19
- Running different steps on a schedule - 2020-04-20
- Updating a Markdown table of contents with a GitHub Action - 2020-07-22
- Using grep to write tests in CI - 2020-08-19
- Skipping a GitHub Actions step without failing - 2020-08-22
- Open a debugging shell in GitHub Actions with tmate - 2020-09-14
- Talking to a PostgreSQL service container from inside a Docker container - 2020-09-18
- Convert a datetime object to UTC without using pytz - 2020-04-19
- macOS Catalina sort-of includes Python 3 - 2020-04-21
- Generated a summary of nested JSON data - 2020-04-28
- Installing and upgrading Datasette plugins with pipx - 2020-05-04
- Use setup.py to install platform-specific dependencies - 2020-05-05
- Build the official Python documentation locally - 2020-05-08
- Introspecting Python function parameters - 2020-05-27
- Password hashing in Python with pbkdf2 - 2020-07-13
- How to call pip programatically from Python - 2020-08-11
- Outputting JSON with reduced floating point precision - 2020-08-21
- Debugging a Click application using pdb - 2020-09-03
- Understanding option names in Click - 2020-09-22
- Running a Python ASGI app on Zeit Now v2 - 2020-04-19
- Lag window function in SQLite - 2020-04-19
- Null case comparisons in SQLite - 2020-04-21
- Compile a new sqlite3 binary on Ubuntu - 2020-04-30
- List all columns in a SQLite database - 2020-05-06
- Using LD_PRELOAD to run any version of SQLite with Python - 2020-06-17
- SQLite BLOB literals - 2020-07-29
- Enabling WAL mode for SQLite database files - 2020-08-09
- Compiling the SQLite spellfix.c module on macOS - 2020-09-19
- Figuring out if a text value in SQLite is a valid integer or float - 2020-09-27
- Running pip install -e .[test] in zsh on macOS Catalina - 2020-04-21
- Get Skitch working on Catalina - 2020-04-21
- Close terminal window on Ctrl+D for macOS - 2020-04-21
- Fixing "compinit: insecure directories" error - 2020-04-26
- Finding the largest SQLite files on a Mac - 2020-08-19
- Use labels on Cloud Run services for a billing breakdown - 2020-04-21
- How to deploy a folder with a Dockerfile to Cloud Run - 2020-08-04
- Using the gcloud run services list command - 2020-09-01
- Session-scoped temporary directories in pytest - 2020-04-26
- How to mock httpx using pytest-mock - 2020-04-29
- Asserting a dictionary is a subset of another dictionary - 2020-05-28
- Registering temporary pluggy plugins inside tests - 2020-07-21
- Code coverage using pytest and codecov.io - 2020-08-15
- Start a server in a subprocess during a pytest session - 2020-08-31
- Accessing repository dependencies in the GitHub GraphQL API - 2020-04-30
- Paginating through the GitHub GraphQL API with Python - 2020-07-09
- Constant-time comparison of strings in Node - 2020-05-01
- Search across all loaded resources in Firefox - 2020-05-05
- Converting HTML and rich-text to Markdown - 2020-05-09
- Rendering Markdown with the GitHub Markdown API - 2020-08-22
- Adding project links to PyPI - 2020-05-11
- Using heroku pg:pull to restore a backup to a macOS laptop - 2020-07-10
- Upgrading a Heroku PostgreSQL database with pg:copy - 2020-07-20
- Programatically accessing Heroku PostgreSQL from GitHub Actions - 2020-08-18
- Implementing a "copy to clipboard" button - 2020-07-23
- Working around the size limit for nodeValue in the DOM - 2020-08-21
- Dynamically loading multiple assets with a callback - 2020-08-21
- Minifying JavaScript with npx uglify-js - 2020-08-30
- Manipulating query strings with URLSearchParams - 2020-10-04
- PostgreSQL full-text search in the Django Admin - 2020-07-25
- Attaching a bash shell to a running Docker container - 2020-08-10
- Packaging a Python CLI tool for Homebrew - 2020-08-11
- Browsing your local git checkout of homebrew-core - 2020-08-27
- Customizing my zsh prompt - 2020-08-12
- Pointing a custom subdomain at Read the Docs - 2020-08-14
- Read the Docs Search API - 2020-08-16
- Creating a dynamic line chart with SVG - 2020-08-22
- Piping echo to a file owned by root using sudo and tee - 2020-08-24
- Basic strace to see what a process is doing - 2020-09-07
- Looping over comma-separated values in Bash - 2020-09-01
- Escaping strings in Bash using !:q - 2020-10-01
- Very basic tsc usage - 2020-09-06
- Display EC2 instance costs per month - 2020-09-06
- Installing Selenium for Python on macOS with ChromeDriver - 2020-10-02
- Using async/await in JavaScript in Selenium - 2020-10-02
- Running Datasette on DigitalOcean App Platform - 2020-10-06