Exyr.org Subscribe

Hi, I’m Simon Sapin. Pronouns are he/him (though I don’t mind the universal they/them). Things I’ve worked on include Mercurial, Rust, Servo, web standards in W3C’s CSS Working Group, and WeasyPrint.

I’m SimonSapin on GitHub and Twitter, @simon@tutut.delire.party on Mastodon. Email to contact at this domain also works.


Borrow cycles in Rust: arenas v.s. drop-checking

Creating cycles with &T borrowed references in rust is tricky, but possible. Drop-checking seems to prevent optimizing practical uses, but there’s an escape hatch (that’s only available on Nightly for now), as well as a hack (that works on Rust Stable).

tinycss: a new CSS parser for Python

I made tinycss, a new free software CSS parser for Python. It is extensible, well-documented, well-tested and fast. It replaces cssutils in both WeasyPrint and CairoSVG.

Low-tech NTP

How to synchronize a Linux computer’s clock when NTP doesn’t work.

Single-threaded event loop for file input and timers

To wait for various events and without polling, a blocking threads for each event is the obvious solution. However, multi-threading comes with its pitfalls and problems. Here we are going to see how to build and event loop the handle multiple event in the same thread.

Programatically open multiple GNOME Terminal tabs

To run several tasks in parallel and keep their output separated, run each one in its own shell. Doing so can be automated, and thus it should. Here is how to open a GNOME Terminal window with multiple tabs from a script.

Random pronounceable passwords

Using a sample text for statistics and Markov chains, we can generate passwords that are both random (and thus strong) and pronounceable (and thus easier to memorize.)

Using Jinja2 in Django

How to replace Django’s templating system by Jinja2 and still profit from it eg. in generic views.

Flask-Static: yet another static website generator

I’ve been working on re-launching my personal website (you’re looking at the result), and wrote a static website generator in the process. It’s made of two Flask extension: Flask-FlatPages gives easy access to content with metadata stored in text files, and Flask-Static takes a snapshot of a Flask application as static files.