Horizontal messaging bus using postal.js

I just came across this series of posts about JavaScript, and they're great! They cover the most recent technologies in the front-end scene nowadays. Among them, there was a concept that I had never heard of before: mediated events. When you use (for instance) jQuery's on, you're saying that whenever

Read more...

FB Hacker Cup - Qualification Round

Last weekend, Facebook launched the qualification round of their Hacker cup, an annual worldwide programming competition. The way this competition works is pretty similar to that of other programming contests out there: a series of programming problems are presented, each of which has a sample input and a sample output

Read more...

Generate a preview image for all the fonts inside a folder with Python

Using Python PIL (a somewhat outdated library, by the way) you can easily generate an image with a preview of all the fonts within a folder. Code is self explanatory:

import Image, ImageFont, ImageDraw  
import os

fontSize = 20  
lineHeight = fontSize + 10  
imageWidth = 800

fontFiles = [f for f in os.listdir

Read more...

Using Function.prototype.bind to reduce event management code

Sometimes, when defining event behavior, you need to add some boilerplate code in cases where a single line should suffice. For instance, if you have an object whose method should be called when a button gets pressed, the usual way of doing it (using jQuery) would be:

$('#theButton').on

Read more...

JavaScript's bind, apply and call

JavaScript has some great functional features backed by a really simple syntax. Some of these are pretty common and you're likely familiar with them, such as anonymous functions to be used as event handlers in jQuery:

$("#my_button").click(function(){
    // magic happens
});

However there are some other functional features that

Read more...

Hola Mundo

¡Hola hola!

echo "Hello world!";

Read more...