A versatile iterator, like the foreach, is a method that allows the iteration of Array, Objects or HTML elements (nodes) collections. Similar method exist in other languages, and can be very useful by using less code, optimized loops and profiting directly from the language enhancements.
Continue reading →
A few days ago, I’ve upgrade the mac ports that included an upgrade for subversion to version 1.7. The problem is that apps like Cornerstone or Netbeans that depend on version 1.6 stopped working
Here’s a quick a simple way to fix it: https://trac.macports.org/wiki/howto/InstallingOlderPort
A few months ago I’ve discovered Sublime Text 2, it looked nice, but I didn’t manage to have the time to look into it in more thoroughly, until now. Sublime Text 2 is awesome.
YUI Compressor is a very useful tool to compress code, JavaScript or CSS. Integrating java based tools in Sublime Text is pretty simple. Here’s how to integrate YUI Compressor.
Continue reading →
The single var pattern is a very simple and straight forward implementation, as opposite of the side effects of not using it. It consists in declaring all the vars in the top of a scope with a single var statement and the variables separated by commas.
Continue reading →
If you use “Chain assignment” or are considering using it, beware of implied globals. Take this example:
function vars()
{
var a = b = "hello";
console.log("a: " + a); // outputs: a: hello
}
vars();
console.log("b: " + b); // outputs: b: hello
console.log("a: " + a); // error not defined