While some of us are blessed with fixed IP addresses, some ISPs don’t offer this option unfortunately. If you’re using the Django INTERNAL_IPS setting to show or hide the debug toolbar this can be a problem. Luckily the Django settings.py files are pure Python and it’s easy enough to work around this issue with a […]
Mastering Python
Mastering Python is finally out and available in your local book store. If you are an experienced Python developer, this might be the book for you. It will teach you the useful new features in Python 3 (currently up to 3.5) and show you a lot of Python tricks that you may not have seen […]
Rendering your STL files with matplotlib using numpy-stl
It’s been a while since the first version of numpy-stl and a lot has changed since. Most importantly, usage has become even easier. So here’s a demo on how to use matplotlib to render your stl files: [python]from stl import mesh from mpl_toolkits import mplot3d from matplotlib import pyplot # Create a new plot figure […]
Reading MT940 files using Python
Some time ago I wrote a library to read MT940 files with Python. While there are multiple libraries available for this target, none of the others really work properly and/or support all variants of the format. The MT940 library I wrote is slightly different, it’s designed to be able to parse any MT940 file, regardless […]
Checking for Python version and Vim version in your .vimrc
Recently I’ve had to adjust a bunch of my dotfiles to support some old (Centos 5) systems which means that I am using a Vim that has Python 2.4 build in… needless to say, it breaks some of my dotfiles 😉 So here’s some tips on patching Vim version issues. First, checking if you have […]
Reading/writing 3D STL files with numpy-stl
For issues and/or questions, create an issue on Github: WoLpH/numpy-stl issues As a followup of my earlier article about reading and writing STL files with Numpy, I’ve created a library that can be used easily to read, modify and write STL files in both binary and ascii format. The library automatically detects whether your file […]
Reading and writing binary STL files with Numpy
I’ve since written a library to replace this script and add more functionality such as reading/writing both binary and ascii STL files. See the blog post here After seeing Sukhbinder’s implementation of reading STL files with Numpy I thought it would be a nice thing to have a simple STL class to both read and […]
Creating a ZFS pool in a Sparseimage or DMG on OS X
Since I see regular corruption and filesystem errors on my HFS+ partitions it seemed time to give ZFS on OS X a try. Since there are several ZFS implementations for OS X available you can choose the one you feel most confident that will work. Regardless… here is the script I wrote to automate the […]
Django template tags within Jinja2
In some cases it can be useful to enable Django tags within your Jinja2 templates, for example… when you are converting your templates but still have some legacy tags/filters that don’t support Jinja2 or if you are using a project without Jinja2 support. Luckily, that’s not too difficult to achieve with Jinja2, actually a lot […]
Batch restoring files in Dropbox recursively (Dropbox Time Machine)
When you are sharing a Dropbox folder with a lot of different people at one point someone will eventually delete the shared folder through his/her file manager instead of dropbox, resulting in having half of the files in the subdirectories being gone. As this got so annoying for my use case I wrote a little […]
Recent Comments