December 2008
4 posts
2 tags
Guard and Default Operators of JavaScript
Programming languages with C-style syntax all have logical operators for AND, OR, and NOT. They are &&, ||, and !, respectively. In Javascript, the way the languages determines logical operations and the values Javascript treats as true or false lead to people using the AND and OR operators for guard and default situations . Let me explain.
Guard and Default? How so?
Here’s a...
2 tags
Overloading Objects in PHP
In PHP, objects are all dynamic. If you declare a variable for object after instantiation, it just throws it right in, no questions asked. Much friendlier than, say, Java, where you absolutely must define a variable prior to use or the JVM will smite you. PHP also lets you define extra or different instructions when using a previously unknown variable with magic functions.
__get and __set
Usually...
1 tag
PuTTY Connection Manager →
PuTTY is on the utility belt of every developer. It’s the most common way we speak to servers and tell them what to do. And if you ever need to command-line to more than one server, you end up with plenty of PuTTY windows open, each connected to a different server, only with an obscure, arbitrary server name or IP address to differentiate.
PuTTY already lets you set up saved connection...
2 tags
Tooltip Image with Mootools
Alright, taking a look at the Mootools docs, and playing around, I’ve quickly learnt how to throw an image into a Tooltip with Mootools. It’s far easier, and far cleaner than what I was doing with version 1.1. The first way still works, and the validator tells me its valid, but it feels dirty.
A little background: the tooltip is built from the title and rel (or href if rel is empty)...