Mypy on steroids
Mypy is a nifty static type checker for Python that will help you nip nasty production bugs in the bud. Especially when you're already in the habit of generously using type hints in your code. Head over to their docs to get started if you're not using Mypy already.
Mypy is kind of slow though. On a code base of 200 Python files it already takes 2 seconds to check the code. Luckily there's a quick fix! You can run Mypy in daemon mode, and it will (partially) cache previous run results and be up to 20 times faster 🚀
To speed things up, just change the Mypy command frommypy <arguments> <file(s)>
like this:
mypy --check-untyped-defs hello_world.py
To dmypy run -- <arguments> <file(s)>
like this:
dmypy run -- --check-untyped-defs hello_world.py
The first time you run the command in daemon mode, it will still be slow as it needs to generate the cached data.
Subsequent calls will be much faster though. For the 200 file code base the run time went down from 2 seconds to just 100ms.
-
Don't commit to main
Prevent accidental commits to a protected branch such as
main
. -
Webroach - xroach for webpages
The story of webroach, how I created the HTML counterpart of the xroach linux application. It is open source, so you too can have some roaches roaming your website.
-
Sane alt-tabbing in Ubuntu - part I
How to change alt-tabbing behavior in Ubuntu to something more useful than the default.