How to set up a RAM drive

lots of RAMOnce you try a solid state drive you never go back. It’s blazingly fast. I complement that experience with a RAM drive to store temporal files, cache and disposable files (screenshots, unzipped files, downloaded attachments).

I’ll explain you how to set up a RAM disk. Spoiler: the hardest part of installing it is downloading the program you’ll need to create it.
Continue reading

Automatically minify CSS and JavaScript files using Git hooks

Motivation

Commented CSS codeWhen I write my CSS code, it usually looks like the screenshot on the right: I use big text made with FIGlet (using this tool) so I can find a section of code fast just by looking at SublimeText‘s minimap. There are also useful comments along the code. Those comments are great while we are working, but if they were left on production they would yield several bytes of overhead.
The JavaScript code is commented too (without big text, in this case) and it also has many spaces for identation.

Solution

There are many tools to reduce the size of both CSS and JavaScript files. In this case I chose YUI Compressor for CSS and Closure compiler for JavaScript. I decided to apply them automatically just before making a commit, using a pre-commit hook.
Keep reading to see how to implement this!
Continue reading

Drawing with a laser

Reading Hack a Day I found an interesting challenge: drawing their logo somewhere. And the fact that was even more interesting: “preference will be given to the largest and smallest submissions“.
I started figuring out how to do something like that with the things I had around, and settled for using a laser and two servos. Even though I missed the deadline for submissions, it became a very interesting project and I learned a lot. Continue reading