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.
320 posts tagged “til”.
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.
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…
Facebook's musicgen is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.
Facebook's musicgen is a model that generates snippets of audio from a text description - it's effectively a Stable Diffusion for music.
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.
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.
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.
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…
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.
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…
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.
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.
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).
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.
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.
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…
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 .
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…
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…
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…