Using Jinja2 in Django
Jinja2 is a templating language inspired by Django’s, but that I find more powerful and less awkward. You can just use it a library in a Django application, but then other parts of Django such as...
View ArticleRandom pronounceable passwords
Update 2015-10-12: These days I have one password that I memorize, generated with Markov chains as described below, used for the disk encryption and login of my laptop. Everything else has strong...
View ArticleProgramatically open multiple GNOME Terminal tabs
Once in a while, apticron tells me that I should do package upgrades on my server. Easy enough: ssh into the server and run sudo aptitude update && sudo aptitude safe-upgrade. That’s a bit too...
View ArticleFlask-Static is dead, long live Frozen-Flask!
Flask-Static is nice but the name was not so great. The “Static” part sounded like it’s about static files (those that come with your app, such as images and CSS,) but it was really not. (Or not...
View ArticleFlask-Static: yet another static website generator
Update 2011-02-21: Flask-Static has been renamed Frozen-Flask.Why static?The modern way of doing web development is to write an application in a high-level language with a pre-built framework. This...
View ArticleSingle-threaded event loop for file input and timers
If an application needs to wait for various events and polling is not possible or desirable, a popular solution is to use a blocking thread for each events. However, multi-threading is easy to get...
View ArticleLow-tech NTP
The network where I live currently is heavily filtered. I believe that UDP from or to the Internet is not allowed at all. As a result, NTP doesn’t work and my computer’s clock does not synchronize...
View ArticleRun a script on file changes with inotify
The workflow for writing software typically goes like this:Make some changes in the source codeRun the program, typically a test suiteWatch the outputRinse and repeatFor me the second step means...
View ArticleWeasyPrint renders HTML+CSS to PDF
WeasyPrint just got its first release! It is a rendering engine for HTML and CSS that produces PDF. I’ve been with Kozea working on it for a few months now.While it uses many libraries to parse HTML...
View ArticleMulticorn: Access foreign data in PostgreSQL with Python
We just released Multicorn. It enables you to write Foreign Data Wrappers for PostgreSQL in Python. Any data source can be exposed as a table and queried with full SQL. A simple wrapper can be as short...
View Articletinycss: a new CSS parser for Python
I’m happy to announce the first release of tinycss! I captured it best in the README, so here it is:tinycss is a complete yet simple CSS parser for Python. It supports the full syntax and error...
View ArticleFlask-WeasyPrint
I just released Flask-WeasyPrint, a new Flask extension that integrates WeasyPrint in your Flask app.You could see it as just an optimization: is by-passes the network for URLs (stylesheet, images, …)...
View ArticleWeasyPrint at PyConFR 2012
I was at PyConFR in Paris on September 15th and 16th. I gave a talk on WeasyPrint and CSS for print.Update 2012-09-12: I made a PDF version of the schedule for printing, of course dogfooding...
View ArticleWeasyPrint at W3C Developer Meetup in Lyon
I gave a talk in the Lyon city hall for the W3C Developer Meetup, titled “WeasyPrint: bring the web to PDF and paper” but (spoiler!) it’s also about W3C and how we got there.Here are the slides with...
View Articlecairocffi: CFFI-based Python bindings for cairo
Note:cairocffi is kinda old news, but I was asked recently about it. This is the anwser, made public.Cairo is a 2D vector graphics library with support for multiple backends including image buffers,...
View ArticleBorrow cycles in Rust: arenas v.s. drop-checking
Ownership and borrowing are the fundamentals of data structures in Rust.However, both taking owneship of a value (moving it) or taking a reference to it can only happen after the value was created....
View Article
More Pages to Explore .....