Farshid's Weblog
Login
Posts tagged “TIL”
Installing lxml for Python on an M1/M2 Mac
(2025-10-18)
Recursively fetching metadata for all files in a Google Drive folder
(2025-10-11)
Open a debugging shell in GitHub Actions with tmate
(2025-09-28)
Running a Python ASGI app on Vercel
(2025-09-27)
SQLite BLOB literals
(2025-09-21)
Understanding option names in Click
(2025-09-21)
Programmatically comparing Python version strings
(2025-09-20)
Publishing to a public Google Cloud bucket with gsutil
(2025-09-20)
Password hashing in Python with pbkdf2
(2025-09-14)
Subqueries in select expressions in SQLite - also window functions
(2025-09-14)
Using lsof on macOS
(2025-09-13)
Logging users out of Auth0
(2025-09-07)
Serving a custom vector web map using PMTiles and maplibre-gl
(2025-09-07)
Using fs_usage to see what files a process is using
(2025-09-06)
Using heroku pg:pull to restore a backup to a macOS laptop
(2025-09-06)
Protocols in Python
(2025-08-31)
Installing Selenium for Python on macOS with ChromeDriver
(2025-08-24)
Packaging a Python CLI tool for Homebrew
(2025-08-24)
struct endianness in Python
(2025-08-23)
Using tree-sitter with Python
(2025-08-23)
Identifying column combination patterns in a SQLite table
(2025-08-16)
Using macOS stickies to display a workshop link on the screen
(2025-08-16)
Reformatting text with Copilot
(2025-08-10)
Snapshot testing with Syrupy
(2025-08-10)
Testing a Click app with streaming input
(2025-07-27)
Running Varnish on Fly
(2025-07-26)
Open external links in an Electron app using the system browser
(2025-07-20)
Ignoring errors in a section of a Bash script
(2025-07-19)
Mocking a Textract LimitExceededException with boto
(2025-07-05)
Upgrading a Heroku PostgreSQL database with pg:copy
(2025-06-21)
Using llama-cpp-python grammars to generate JSON
(2025-06-21)
Redirecting a whole domain with Cloudflare
(2025-06-15)
Using io.BufferedReader to peek against a non-peekable stream
(2025-06-01)
Using custom Sphinx templates on Read the Docs
(2025-05-31)
Publishing a simple client-side JavaScript package to npm with GitHub Actions
(2025-05-25)
Streaming output of an indented JSON array
(2025-05-25)
Testing against Python 3.11 preview using GitHub Actions
(2025-05-18)
Rate limiting by IP using Cloudflare's rate limiting rules
(2025-05-10)
Training nanoGPT entirely on content from my blog
(2025-05-10)
Whisky sour
(2025-05-04)
Minifying JavaScript with npx uglify-js
(2025-05-03)
Replicating SQLite with rqlite
(2025-05-03)
Running self-hosted QuickJS in a browser
(2025-05-03)
Simple load testing with Locust
(2025-05-03)
Running tests against multiple versions of a Python dependency in GitHub Actions
(2025-04-27)
Lazy loading images in HTML
(2025-04-26)
Using boto3 from the command line
(2025-04-26)
Manipulating query strings with URLSearchParams
(2025-04-20)
macOS Catalina sort-of includes Python 3
(2025-04-19)
Serving a JavaScript project built using Vite from GitHub Pages
(2025-04-19)
Using the gcloud run services list command
(2025-04-19)
Paginating through the GitHub GraphQL API with Python
(2025-04-13)
Pausing traffic and retrying in Caddy
(2025-04-06)
Syntax highlighting Python console examples with GFM
(2025-04-06)
impaste: pasting images to piped commands on macOS
(2025-03-30)
Trying out Quarto on macOS
(2025-03-30)
Turning on Jinja autoescaping when using Template() directly
(2025-03-30)
Running Python code in a Pyodide sandbox via Deno
(2025-03-29)
Run Python code in a WebAssembly sandbox
(2025-03-22)
Trying out the facebook/musicgen-small sound generation model
(2025-03-22)
Using the Fly Docker registry
(2025-03-22)
Syncing slide images and audio in iMovie
(2025-03-16)
Using cog to update --help in a Markdown README file
(2025-03-16)
Using sphinx.ext.extlinks for issue links
(2025-03-08)
Wider tooltip areas for Observable Plot
(2025-03-01)
Trying out SQLite extensions on macOS
(2025-02-23)
Outputting JSON with reduced floating point precision
(2025-02-22)
Publishing a Docker container for Microsoft Edit to the GitHub Container Registry
(2025-02-15)
Wildcard DNS and SSL on Fly
(2025-02-15)
Running OCR against a PDF file with AWS Textract
(2025-02-09)
Using DuckDB in Python to access Parquet data
(2025-02-08)
Using VCR and pytest with pytest-recording
(2025-01-26)
Installing flash-attn without compiling it
(2025-01-25)
Using GPT-3 to figure out jq recipes
(2025-01-25)
Using pprint() to print dictionaries while preserving their key order
(2025-01-25)
Session-scoped temporary directories in pytest
(2025-01-18)
SQLite pragma_function_list()
(2025-01-18)
Vega-Lite bar charts in the same order as the data
(2025-01-18)
Introspecting Python function parameters
(2025-01-12)
Recovering data from AWS Lightsail using EC2
(2025-01-11)
Testing things in Fedora using Docker
(2025-01-05)
Querying the GitHub archive with the ClickHouse playground
(2024-12-22)
Running multiple servers in a single Bash script
(2024-12-22)
Signing and notarizing an Electron app for distribution using GitHub Actions
(2024-12-22)
Using build-arg variables with Cloud Run deployments
(2024-12-22)
Treating warnings as errors in pytest
(2024-12-14)
Using jq in an Observable notebook
(2024-12-14)
SQLite triggers
(2024-12-08)
Storing and serving related documents with openai-to-sqlite and embeddings
(2024-12-07)
mlc-chat - RedPajama-INCITE-Chat-3B on macOS
(2024-12-01)
Upgrade Postgres.app on macOS
(2024-12-01)
Using Jest without a package.json
(2024-12-01)
Looping over comma-separated values in Bash
(2024-11-23)
Pisco sour
(2024-11-17)
Search and replace with regular expressions in VS Code
(2024-11-16)
migrations.RunSQL.noop for reversible SQL migrations
(2024-11-03)
Running gdb against a Python process in a running Docker container
(2024-11-03)
Using the tesseract CLI tool
(2024-11-03)
kubectl proxy
(2024-11-02)
Removing a git commit and force pushing to remove it from history
(2024-10-26)
Reading thermometer temperatures over time from a video
(2024-10-20)
Testing cookiecutter templates with pytest
(2024-10-13)
Importing CSV data into SQLite with .import
(2024-10-12)
Increasing the time limit for a Google Cloud Scheduler task
(2024-10-12)
Using C_INCLUDE_PATH to install Python packages
(2024-10-12)
Using psutil to investigate "Too many open files"
(2024-10-12)
Lag window function in SQLite
(2024-10-06)
One-liner for running queries against CSV files with SQLite
(2024-10-06)
Running Docker on an M1 Mac
(2024-10-06)
Tracing every executed Python statement
(2024-10-06)
Using nginx to proxy to a Unix domain socket
(2024-10-06)
Writing JavaScript that responds to media queries
(2024-10-06)
Mocking Stripe signature checks in a pytest fixture
(2024-10-05)
Using git-filter-repo to set commit dates to author dates
(2024-10-05)
Using the sqlite3 Python module in Pyodide - Python WebAssembly
(2024-10-05)
Intercepting fetch in a service worker
(2024-09-29)
Installing tools written in Go
(2024-09-28)
Rewriting a repo to contain the history of just specific files
(2024-09-28)
Upgrading a pipx application to an alpha version
(2024-09-28)
Using SQL with GDAL
(2024-09-28)
Running pytest against a specific Python version with uv run
(2024-09-22)
Streaming indented output of a JSON array
(2024-09-22)
Reusing an existing Click tool with register_commands
(2024-09-21)
Running a gpt-oss eval suite against LM Studio on a Mac
(2024-09-21)
Saving an in-memory SQLite database to a file in Python
(2024-09-15)
Using awk to add a prefix
(2024-09-14)
Skipping CSV rows with odd numbers of quotes using ripgrep
(2024-08-31)
Start, test, then stop a localhost web server in a Bash script
(2024-08-31)
Loading radio.garden into SQLite using jq
(2024-08-25)
Switching between gcloud accounts
(2024-08-18)
Writing Fly logs to S3
(2024-08-18)
__init_subclass__
(2024-08-17)
Social media cards generated with shot-scraper
(2024-08-17)
The simplest recursive CTE
(2024-08-17)
Making HTTP calls using IPv6
(2024-08-04)
Updating stable docs in ReadTheDocs without pushing a release
(2024-08-04)
Working around the size limit for nodeValue in the DOM
(2024-08-04)
KNN queries with SpatiaLite
(2024-08-03)
Pointing a custom subdomain at Read the Docs
(2024-08-03)
The location of the pip cache directory
(2024-08-03)
Upgrading Homebrew and avoiding the failed to verify attestation error
(2024-08-03)
Using recursive CTEs to explore hierarchical Twitter threads
(2024-07-28)
pytest coverage with context
(2024-07-21)
Transferring a GitHub issue from a private to a public repository
(2024-07-21)
SQLite VACUUM: database or disk is full
(2024-07-20)
Running jupyterlab via uv tool install
(2024-07-14)
Installing different PostgreSQL server versions in GitHub Actions
(2024-07-13)
Publishing a Web Component to npm
(2024-07-13)
Implementing a "copy to clipboard" button
(2024-07-06)
Quickly testing code in a different Python version using pyenv
(2024-07-06)
Limited JSON API for Google searches using Programmable Search Engine
(2024-06-30)
Start a server in a subprocess during a pytest session
(2024-06-29)
Using async/await in JavaScript in Selenium
(2024-06-29)
Using OpenAI functions and their Python library for data extraction
(2024-06-29)
Using Prettier to check JavaScript code style in GitHub Actions
(2024-06-23)
Installing packages from Debian unstable in a Docker image based on stable
(2024-06-22)
Redirecting all paths on a Vercel instance
(2024-06-22)
Testing different Python versions with uv with-editable and uv-test
(2024-06-16)
Migrating a GitHub wiki from one repository to another
(2024-06-15)
Processing a stream of chunks of JSON with ijson
(2024-06-09)
Upgrading packages with npm
(2024-06-09)
Registering the same Pluggy hook multiple times in a single file
(2024-06-08)
Running cog automatically against GitHub pull requests
(2024-06-08)
Safely outputting JSON
(2024-06-08)
Livestreaming a community election event on YouTube
(2024-06-02)
Registering temporary pluggy plugins inside tests
(2024-06-01)
Summarizing Hacker News discussion themes with Claude and LLM
(2024-06-01)
Trick Apple Photos into letting you access your video files
(2024-05-25)
Useful Markdown extensions in Python
(2024-05-19)
Named Entity Resolution with dslim/distilbert-NER
(2024-05-18)
Setting cache-control: max-age=31536000 with a Cloudflare Transform Rule
(2024-05-12)
The pdb interact command
(2024-05-12)
Using ChatGPT to write AppleScript
(2024-05-12)
Restricting SSH connections to devices within a Tailscale network
(2024-05-11)
Using grep to write tests in CI
(2024-05-11)
Sort by number of JSON intersections
(2024-05-05)
Running pip install -e .[test] in zsh on macOS Catalina
(2024-05-04)
Seeing files opened by a process using opensnoop
(2024-05-04)
Using Tesseract.js to OCR every image on a page
(2024-05-04)
Mocking subprocess with pytest-subprocess
(2024-04-28)
Using the undocumented Fly GraphQL API
(2024-04-28)
sips: Scriptable image processing system
(2024-04-20)
Piping echo to a file owned by root using sudo and tee
(2024-04-14)
Publish releases to PyPI from GitHub Actions without a password or token
(2024-04-14)
SQLite aggregate filter clauses
(2024-04-14)
Turning an array of arrays into objects with jq
(2024-04-14)
JSON Pointer
(2024-04-13)
Listen to a web page in Mobile Safari
(2024-04-13)
Running different steps on a schedule
(2024-04-13)
Summing columns in remote Parquet files using DuckDB
(2024-04-13)
TOML in Python
(2024-04-13)
Running pip install '.[docs]' on ReadTheDocs
(2024-04-07)
Show files opened by pytest tests
(2024-04-07)
Simplest possible OAuth authentication with Auth0
(2024-04-06)
Set a GIF to loop using ImageMagick
(2024-03-30)
Piping from rg to llm to answer questions about code
(2024-03-24)
SQLite can use more than one index for a query
(2024-03-10)
Loading lit from Skypack
(2024-03-09)
Using iconv to convert the text encoding of a file
(2024-03-09)
SQLite timestamps with floating point seconds
(2024-03-03)
Promoting the stable version of the documentation using rel=canonical
(2024-03-02)
Querying for GitHub issues open for less than 60 seconds
(2024-03-02)
Using S3 triggers to maintain a list of files in DynamoDB
(2024-03-02)
The most basic possible Hugo site
(2024-02-25)
Listing files uploaded to Cloud Build
(2024-02-24)
Show the SQL schema for a PostgreSQL database
(2024-02-24)
Using the ChatGPT streaming API from Python
(2024-02-24)
JavaScript date objects
(2024-02-17)
Python packages with pyproject.toml and nothing else
(2024-02-17)
Tailing Google Cloud Run request logs and importing them into SQLite
(2024-02-17)
Trying out Python packages with ipython and uvx
(2024-02-17)
os.remove() on Windows fails if the file is already open
(2024-02-11)
Verifying your GitHub profile on Mastodon
(2024-02-11)
Querying for items stored in UTC that were created on a Thursday in PST
(2024-02-04)
Running Dolly 2.0 on Paperspace
(2024-02-04)
Trying out free-threaded Python on macOS
(2024-02-03)
WebAuthn browser support
(2024-01-27)
Run pytest against a specific Python version using Docker
(2024-01-21)
Skipping a GitHub Actions step without failing
(2024-01-20)
Transcribing MP3s with whisper-cpp on macOS
(2024-01-20)
Using a Tailscale exit node with GitHub Actions
(2024-01-20)
Using unnest() to use a comma-separated string as the input to an IN query
(2024-01-13)
Workaround for google-github-actions/setup-gcloud errors
(2024-01-07)
The SQLite now argument is stable within the same query
(2024-01-06)
Using namedtuple for pytest parameterized tests
(2023-12-31)
Packaging a Python app as a standalone binary with PyInstaller
(2023-12-30)
Providing a "subscribe in Google Calendar" link for an ics feed
(2023-12-23)
The Wikipedia page stats API
(2023-12-17)
Read the Docs Search API
(2023-12-10)
Reporting bugs in GitHub to GitHub
(2023-12-10)
Splitting on commas in SQLite
(2023-12-10)
Using curl to run GraphQL queries from the command line
(2023-12-03)
Installing Python on macOS with the official Python installer
(2023-11-26)
Testing the Access-Control-Max-Age CORS header
(2023-11-26)
Writing an Azure Function that serves all traffic to a subdomain
(2023-11-26)
Only run GitHub Action on push to master / main
(2023-11-25)
Quick and dirty mock testing with mock_calls
(2023-11-19)
Running Ethernet over existing coaxial cable
(2023-11-19)
Using Playwright MCP with Claude Code
(2023-11-19)
Scroll page to form if there are errors
(2023-11-18)
Styling an HTML dialog modal to take the full height of the viewport
(2023-11-18)
Writing pytest tests against tools written with argparse
(2023-11-18)
Running PyPy on macOS using Homebrew
(2023-11-05)
Scraping the Sky News Westminster Accounts, a Flourish application
(2023-11-05)
Understanding the CSS auto-resizing textarea trick
(2023-11-05)
Track timestamped changes to a SQLite table using triggers
(2023-10-28)
Rewriting a Git repo to remove secrets from the history
(2023-10-15)
Search across all loaded resources in Firefox
(2023-10-14)
Using Fabric with an SSH public key
(2023-10-14)
Scroll to text fragments
(2023-10-01)
Planning parallel downloads with TopologicalSorter
(2023-09-30)
literalinclude with markers for showing code in documentation
(2023-09-24)
Understanding Kristofer Joseph's Single File Web Component
(2023-09-24)
Searching for repositories by topic using the GitHub GraphQL API
(2023-09-23)
List all columns in a SQLite database
(2023-09-17)
Null case comparisons in SQLite
(2023-09-17)
Storing files in an S3 bucket between GitHub Actions runs
(2023-09-17)
Local wildcard DNS on macOS with dnsmasq
(2023-09-09)
Using json_extract_path in PostgreSQL
(2023-09-09)
Upgrading Python Homebrew packages using pip
(2023-09-03)
Using the GitHub Actions cache with npx and no package.json
(2023-09-03)
Returning related rows in a single SQL query using JSON
(2023-08-20)
Mouse support in vim
(2023-08-19)
Pixel editing a favicon with Pixelmator
(2023-08-13)
Logging OpenAI API requests and responses using HTTPX
(2023-08-12)
Testing Electron apps with Playwright and GitHub Actions
(2023-08-06)
shot-scraper for a subset of table columns
(2023-08-05)
Opt-in integration tests with pytest --integration
(2023-07-29)
Using ChatGPT Browse to name a Python package
(2023-07-23)
Rendering Markdown with the GitHub Markdown API
(2023-07-22)
Redirecting a domain using Cloudflare Pages
(2023-07-16)
Trying out cr-sqlite on macOS
(2023-07-15)
Setting up a custom subdomain for a GitHub Pages site
(2023-07-09)
Scraping Reddit via their JSON API
(2023-07-08)
Optimizing PNGs in GitHub Actions using Oxipng
(2023-07-02)
Using LD_PRELOAD to run any version of SQLite with Python
(2023-07-01)
Passing command arguments using heredoc syntax
(2023-06-18)
Loading SQLite extensions in Python on macOS
(2023-06-17)
Using packages from JSR with esbuild
(2023-06-17)
Interpreting photo orientation and locations in EXIF data
(2023-06-11)
Relinquishing control in Python asyncio
(2023-05-28)
Shrinking PNG files with pngquant and oxipng
(2023-05-20)
Using the Chrome DevTools console as a REPL for an Electron app
(2023-05-07)
Using pysqlite3 on macOS
(2023-05-06)
Ignoring a line in both flake8 and mypy
(2023-04-30)
Using pipenv and Docker
(2023-04-23)
Programatically accessing Heroku PostgreSQL from GitHub Actions
(2023-04-22)
Testing HTML tables with Playwright Python
(2023-04-22)
Use setup.py to install platform-specific dependencies
(2023-04-16)
Running nanoGPT on a MacBook M2 to generate terrible Shakespeare
(2023-04-09)
Running tests against PostgreSQL in a service container
(2023-04-09)
Tommy's Margarita
(2023-04-09)
nullglob in bash
(2023-04-02)
Language-specific indentation settings in VS Code
(2023-04-01)
Writing tests with Copilot
(2023-04-01)
Running prompts against images, PDFs, audio and video with Google Gemini
(2023-03-19)
Linking from /latest/ to /stable/ on Read The Docs
(2023-03-18)
Running a MySQL server using Homebrew
(2023-03-18)
Using expect() to wait for a selector to match multiple items
(2023-03-05)
Running Python code in a subprocess with a time limit
(2023-02-26)
Tracking SQLite table history using a JSON audit log
(2023-02-25)
Very basic tsc usage
(2023-02-25)
Ordered group_concat() in SQLite
(2023-02-18)
Querying newline-delimited JSON logs using AWS Athena
(2023-02-05)
Set environment variables for all steps in a GitHub Action
(2023-02-05)
Using uv to develop Python command-line applications
(2023-02-05)
Using pytest and Playwright to test a JavaScript web application
(2023-02-04)
Preventing double form submissions with JavaScript
(2023-01-28)
Writing tests for the ASGI lifespan protocol with HTTPX
(2023-01-28)
Running LLaMA 7B and 13B on a 64GB M2 MacBook Pro with llama.cpp
(2023-01-22)
Reviewing your history of public GitHub repositories using ClickHouse
(2023-01-21)
Updating a Markdown table of contents with a GitHub Action
(2023-01-15)
Running OpenAI's large context models using llm
(2023-01-08)
Unix timestamp in milliseconds in SQLite
(2023-01-08)
Use labels on Cloud Run services for a billing breakdown
(2023-01-08)
Talking to a PostgreSQL service container from inside a Docker container
(2023-01-01)