So, I hopped in a cab this morning to get to work and my Aussie driver was listening to that asshat Alan Jones on his radio. Mr. Jones mentioned something about immigration and my cabbie just goes off. For the next 5 minutes it was all, "Fucking immigrants THIS." and "Fucking immigrants THAT." and so forth. He turns to me and asks me how I feel, so I kindly say, "Well, technically, I'm an immigrant, but I suppose THAT doesn't matter to you because I'm white."

Needless to say, he let me out of cab early.

Qquote

A quote posted on the 29th of August 2011 under Meh.

"Light a man a fire and keep him warm for the rest of the day. Light a man ON fire, you keep him warm for the rest of his life."
Wisdom of Wilhelm

Here's a simple command I just used to completely remove all of those pesky .svn directories Subversion likes to place everywhere. Comes in handy when you have a MASSIVE project with tons of subdirectories (cough Magento cough). Just go into your terminal app and type the following:

sudo find . -type d -name .svn | xargs rm -rf

This will effectively remove all .svn directories beneath your present working directory. Be careful with this one!

Best. Burger. Ever.

Pphoto

A photo posted on the 16th of August 2011 under Food

Best. Burger. Ever.

— Best. Burger. Ever. —

I was bored and wanted something fun to do last night. So, what's more fun than making something you can stuff your face with? That's OK, I can't think of anything either. Anyhow, I found this recipe on CookPad and thought to myself, "Why the hell not?" Best recent food decision ever.

Qquote

A quote posted on the 16th of August 2011 under FML

"Asking a developer to make updates to a proprietary piece of software with NO guidance and NO documentation is the same as telling an electrician to rewire an old building without access to the original plans and blueprints. Document all the things."
Wisdom of Wilhelm

So, I've been toying around with Vagrant (version 0.8.2) for the past few days, trying to get it up and running. If it isn't Ruby crashing my machine by causing kernel panics, it's the latest version of VirtualBox (version 4.1), which is required by the latest version of Vagrant. I've discovered that Vagrant, when randomly crashing, doesn't always properly teardown the active VMs it creates. Naturally, this hogs up resources and you end up wondering why your machine performs slower and slower over time.

You might say to yourself, "Well, I could just hop into the VirtualBox GUI and turn them off manually." But, nay, that does not work as Vagrant locks the sessions of its VMs when not running in GUI mode. So, you're left with x amount of VMs listed right before your eyes with no way of shutting them down. Obviously, you could manually kill the process from Terminal.App or through Activity Monitor, but I've discovered a much easier way.

VirtualBox comes packaged with a command line management system called VBoxManage. You can use this command to manually force the termination of hung (lol, "hung") VMs.

It's insanely easy. Check it out...

I was doodling around with jQuery plugins again and ran into a situation where I needed to create special CSS classes during runtime. After some fiddling about I came to the obvious conclusion that you can simply append a <style> element to the DOM and then add whatever rules you may wish to use.

Here are a few variations on how this can be accomplished:

$('<style>')
.text('.foo { color: #fff; background: #000 none; padding: 3px; }')
.appendTo('head');

Or:

$('<style>.foo { color: #fff; background: #000 none; padding: 3px; }</style>')
.appendTo('head');

You can then assign this new class to any element within the DOM like so:

$('span').addClass('foo');

This is one of those situations where the solution is so obvious it goes right over your head; hidden in plain site, I suppose. Anyhow, I thought I'd share so others don't feel like complete jackasses when they figure this out after hours of banging their heads on their keyboards.

I was curious as to how many tables were in the base install of Magento. My desktop client, Sequel Pro, doesn't provide this information within the interface, so I threw together this quick query. I thought I'd share it as I'm sure I'm not the only one who may need this information.

SELECT count(1) TABLES
    FROM information_schema.TABLES
WHERE table_schema= 'DATABASENAME'

Just replace DATABASENAME with the name of the actual database whose tables you wish to count.

jQuery Plugin > Score

Aarticle

An article posted on the 24th of June 2011 under DOM, JavaScript and jQuery

I've been thinking about making a sort of "Wack-a-Mole" game with that jQuery Wiggle plugin I made a while back. I wanted to add an arcade-game-like scoring effect I could apply to the individual tiles. Since I've been playing with jQuery plugins lately, I thought turning effect into one would be a great idea.

So, today, during my last day at work, I took a few hours of my time and threw one together. All in all, I'm pretty happy with it. It does exactly what I envisioned and it's pretty customisable as well.

Pretty much useless to most people, but not too shabby.

  1. Demonstration
  2. Download

The other night, while coding, I needed a method which would not only output the HTML markup of a specified DOM element's children, but to include the markup of the specified element as well. Internet Explorer has a well-documented outerHTML property built into its rendering engine which does just that. Unfortunately, this does not work cross-browser.