til

320 posts tagged “til”.

  1. 2025
  2. Running Python code in a Pyodide sandbox via Deno

    I continue to seek a solution to the Python sandbox problem. I want to run an untrusted piece of Python code in a sandbox, with limits on memory and time.

    2 min read
  3. Run Python code in a WebAssembly sandbox

    I've been trying to figure this out for ages. Tim Bart responded to my call for help on Hacker News with this extremely useful code example showing how to run Python code in WebAssembly inside Python…

    1 min read
  4. Trying out the facebook/musicgen-small sound generation model

    Facebook's musicgen is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.

    1 min read
  5. Trying out the facebook/musicgen-small sound generation model

    Facebook's musicgen is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.

    1 min read
  6. Using the Fly Docker registry

    Fly.io lets you deploy Docker containers that will be compiled as a Firecracker VM and run in locations around the world. Fly offer a number of ways to build and deploy apps.

    2 min read
  7. Syncing slide images and audio in iMovie

    I found an MP3 recording of an old talk I gave and decided to use the slides from that talk to create a video using iMovie.

    1 min read
  8. Using cog to update --help in a Markdown README file

    My csvs-to-sqlite README includes a section that shows the output of the command (relevant issue). I had been manually copying this in, but I decided to try using cog to automate the process.

    1 min read
  9. Using sphinx.ext.extlinks for issue links

    Datasette's release notes are formatted using Sphinx. Almost every bullet point links to the corresponding GitHub issue, so they were full of lines that look like this: I noticed that the aspw…

    1 min read
  10. Wider tooltip areas for Observable Plot

    In this Observable notebook I'm plotting a line on a chart, but I want to provide tooltips showing the exact value at any point on the line.

    1 min read
  11. Trying out SQLite extensions on macOS

    Alex Garcia has been building some really cool new custom extensions for SQLite, working in C and Go. So far he's released two: - sqlite-lines, written in C, which adds and table-valued functions, for…

    2 min read
  12. Outputting JSON with reduced floating point precision

    datasette-leaflet-geojson outputs GeoJSON geometries in HTML pages in a way that can be picked up by JavaScript and used to plot a Leaflet map.

    1 min read
  13. Publishing a Docker container for Microsoft Edit to the GitHub Container Registry

    Microsoft recently released Edit, a new terminal text editor written in Rust. It's pretty nice - it's reminiscent of but with a retro MS DOS feel. I wanted to run it on my Apple Silicon Mac.

    2 min read
  14. Wildcard DNS and SSL on Fly

    Fly makes it surprisingly easy to configure wildcard DNS, such that is served by a single Fly application (which can include multiple instances in multiple regions with global load-balancing).

    2 min read
  15. Running OCR against a PDF file with AWS Textract

    Textract is the AWS OCR API. It's very good - I've fed it hand-written notes from the 1890s and it read them better than I could.

    2 min read
  16. Using DuckDB in Python to access Parquet data

    Did a quick experiment with DuckDB today, inspired by the bmschmidt/hathi-binary repo. That repo includes 3GB of data in 68 parquet files. Those files are 45MB each.

    1 min read
  17. Using VCR and pytest with pytest-recording

    pytest-recording is a neat pytest plugin that makes it easy to use the VCR library, which helps write tests against HTTP resources by automatically capturing responses and baking them into a YAML file…

    1 min read
  18. Installing flash-attn without compiling it

    If you ever run into instructions that tell you to do this: Do not try to do this . It is a trap. For some reason attempting to install this runs a compilation process which can take multiple hours .

    1 min read
  19. Using GPT-3 to figure out jq recipes

    I like jq, but I always have to think pretty hard about how to construct the right syntax for it. I wanted to sum up the total number of comments in JSON that looks like this (truncated example): The…

    1 min read
  20. Using pprint() to print dictionaries while preserving their key order

    While parsing a CSV file using today I noticed the following surprising result: This output the following: I had expected to preserve the order of keys from the CSV file, since Python has defaulted to…

    1 min read
  21. Session-scoped temporary directories in pytest

    I habitually use the fixture in pytest to get a temporary directory that will be cleaned up after each test, but that doesn't work with - which can be used to ensure an expensive fixture is run only…

    1 min read