I use Python at work and for private projects. I also aim to write tests for my code, especially recently. And as I usually don’t start from 100% code coverage (TDD is not my game), I at least want to know if the code I just wrote have full …
read moreOther articles
-
-
Recurring events are hard
It was almost a month ago when I announced the development of Calendar.social. Since then I’m over some interesting and some less interesting stuff; (web) development, after all, is just a recurrence of patterns. Speaking of recurrence, I arrived to a really interesting topic: recurring events.
My initial …
read more -
Please welcome Calendar.social
-
Add SysAdmin day to Emacs Calendar
I’m a SysAdmin since 1998. Maybe a bit earlier, if you count managing our home computer. This means SysAdmin Day is also celebrating me. However, my Emacs Calendar doesn’t show it for some reason.
The solution is pretty easy:
read more(add-to-list 'holiday-other-holidays '(holiday-float 7 5 -1 "SysAdmin Day") t …
-
Category-based logging with Flask
I’m in a team who are developing a Flask-based web application, which uses logging extensively. For a while now it spews out a lot of lines so the need arose to index them in ElasticSearch, and more importantly, to search through them for auditing purposes. This latter user story …
read more -
Rename automatically named foreign keys with Alembic
I have recently messed up my Alembic migrations while modifying my SQLAlchemy models. To start with, I didn’t update the auto-generated migration files to name the indexes/foreign keys a name, so Alembic used its own naming scheme. This is not an actual problem until you have to modify …
read more -
Finding non-translated strings in Python code
When creating multilingual software, be it on the web, mobile, or desktop, you will eventually fail to mark strings as translatable. I know, I know, we developers are superhuman and never do that, but somehow I stopped trusting myself recently, so I came up with an idea.
Right now I …
read more -
Slugify in Python 3
Today I needed a function to create a slug (an ASCII-only representation of a string). I went Googling a bit, and found an excellend Flask snippet. Problem is, it is designed for Python 2, so I came up with a Python 3 version.
read moreimport re from unicodedata import normalize …
-
Add Python docstring to the beginning of anything in Emacs
Now that I write Python code for a living, I write a lot of functions, classes, and modules. What I still tend to forget, and also find tedious, is adding docstrings. Unlike many developers, writing documentation is not an enemy of mine, but it usually comes to my mind when …
read more
Page 1 / 7 »