npm install not installing all the packages

A few days ago I was trying to install a project’s dependencies with a simple npm install, but in the instructions I was given there was an extra step to manually install one additional package. When I checked package.json, the package was there… So, what was going on!? After searching for a while, it turns out that […]

Fixing Python virtualenv on OS X

This weekend I’ve been toying with an old project I created in Django a while (~2 years) ago. The project uses virtualenv, as commonly happens in this kind of projects. The original project was created originally on a different machine, and migrated to the current one. Original machine had OS X Lion, I think… or Snow […]

FizzBuzz in CSS

The next time an interviewer asks you to solve FizzBuzz, impress them by doing it without a programming language. pic.twitter.com/oYo4iAfr8h — Eric Wastl (@ericwastl) November 20, 2015

Generating Repetitive CSS with Loops in LESS

Less is an amazing tool for simplifying your CSS: allows you to “extend” selectors (i.e. put selectors inside other selectors), to use mixins (i.e. a kind of “functions” that allow repeating optionally parametrized sets of CSS rules) and to use variables. One missing feature is not having loops, for example to create a repetitive rule. […]

Atomically increment a limited value in MySQL and PHP

Sometimes you need to acquire a limited resource in an atomically, concurrent way. This is what semaphores are for. But when this resource is in a MySQL row, apparently there is no straightforward way of doing it. In my case, I had a row with two fields used to limit maximum resource usage: ‘used’ and […]