I started learning Python four years ago and have been heavily programming with it for near than a year now. In this post I’ll share some tools I use to ease and speed-up my workflow, either in the Python code or in the development environment.
Command-T is a wonderful Vim plugin which allows you to open files
with a minimal number of keystrokes. It’s really handy in a large
codebase where you only have to type
<leader>t, then a couple letters and
press enter to open your file. It’s based on a fuzzy matching, which let you
skip letters without worrying.
I recently installed the plugin on another machine and noticed it was really low: I had to wait a couple seconds to get the files list everytime. My computer has 8GB RAM so the problem wasn’t there.
When I started writing Clojure, I couldn’t memorize the difference between
cons and always used one instead of the another. Their name are
cons is used to add an element at the beginning of a vector,
conj is used to add an element at the end of it. How can one memorize
this? I found a mnemonic trick over the time that helps me remember this. Here
When plotting with
gnuplot-py on OSX, I got an annoying warning
saying that terminal
unknown or ambiguous, even when I use a
different terminal (e.g.
postscript). This terminal doesn’t exist on my
Gnuplot installation (4.6.3). In fact,
gnuplot-py uses slightly
different files depending on your platform. OSX’s one is exactly the same as
other UNIX-flavored OSes but its default terminal is
aqua. There are two ways
to fix the warning, a hacky one I used before this blog post, and a clean one I
discovered while writting this post. Hope this help!
Coveralls is a service that keep track of your tests coverage for you. It can notifies you when your coverage decreases under a custom threshold, and their bot comments on pull requests to report their tests coverage. Like Travis-CI, it allows you to add a badge to your readme with an up-to-date tests coverage percentage.
If you already test your GitHub projects with a CI server like Travis, it’s very easy to add Coveralls to your workflow. Unfortunately, they have a library for Ruby, a couple user-provided libraries for other languages such as PHP, Java and Python, but nothing for Clojure. Fortunately, they provide an API for unsupported languages like Clojure. Here is how to use it.
is a method of software testing that examines the
functionality of an application (e.g. what the software does) without peering
into its internal structures or workings (Wikipedia). While it’s
usually done at a system level, I think the most obvious place it should be
used is at the function level. It’s even more efficient if you write tests for
someone else’s code.
Here is how I write unit tests for functions.
I discovered a great feature in Vim today. While we generally
use the same Vim settings everywhere, we sometimes (have to) contribute to
projects with a coding style different of ours, and because nobody wants to
.vimrc everytime to switch between configurations, Vim allows you
to have per project
In this post, we’ll create a custom TLD for local development, and configure
Apache to work with that. It’ll allow you to work on your local version of
mysuperwebsite.com with the local domain
mysuperwebsite.dev, with the exact
same URLs, except that little
.com which is replaced by
When working with Internet protocols, we have to read RFCs a lot. They
can be found on the Web, but it’s better to have them directly in the terminal.
Ubuntu provide some packages to have them offline, but if you aren’t a
sudoer, you can’t install them with
apt-get. So I needed a little script to
fetch RFCs from IETF’s website and read them locally.
Spotify’s Web app is great, but you may prefer to use the desktop client. The problem is that the links default to the Web app. Here is a quick tip to make what you want.