Monday, June 28, 2010

Hacking line numbers into embedded gists

Github has the only corporate mascot in existence that I fantasize about touching inappropriately.




When github unveiled their gist service in 2008, I went into my room, jumped up on my bed, ripped all the playboy posters off the ceiling and taped up a giant portrait of the octocat.

But HOT DAYYUMN is github's lack of line numbers on their embedded gists pissing me off! I've been trying to write another raving containing a reasonable amount of code that is explained over the course of the post — pretty fucking hard without line numbers!

So I went and wrote some javascript hacks to add line numbers in for me.

The hacks

I originally tried to do it with prototype, but was having so much trouble getting it to work on IE6 that I decided to try out jquery instead. Cunting fuck I hate fucking Internet Explorer 6! Ive lost count of the number of rape fantasies I've had about Bill Gates! Anyway, check out these hacks below — maximum credit goes to gaving for refactoring them into not sucking.



Notice those line numbers? ZOMG!


How to use said hacks

Its easy, check out this example:

Its worth noting that the url for the "line number hackz0r script" is from the "view raw" link of the previous gist. If you remove the SHA1 from the url, it seems it always grabs the latest revision of the gist.

Monday, June 21, 2010

The best of Lardcore Volume Three

The other day I was rummaging around looking through the old junk on my hard drive. You know what I'm talking about. Those nostalgic moments when you rediscover some old game you spent ages getting to compile but never really played, or several incrementing versions of the JVM you saved over a period of time, or some long lost porn, or some filthy hacks to download porn, or some hentai that was so fucking funny you just had to save it for later but then forgot where the fuck you stashed it... Anyway, I discovered this edition of Lardcore. It's a few years old, but so priceless(ly retarded) that it has to be aired. Enjoy.

Image(1077)

This picture was taken in the midst of a terrible struggle for survival. Let me tell you a tale...

Once upon a time I took a Computer Science paper at The Ronald McDonald University for the Rectally Handicapped*. Midway through the course I was unfairly failed for one of the tests, and trudged up to the lecturers office to clear things up...

Looking me square in the eye he said, "Son, the reason I failed you is because your brain is composed largely of faeces. You suck more balls than a one legged man in an ass kicking contest". Clearly there was no changing his mind. Oh well. Plan B. "Sir", I began, "allow me to take a moment to fill you in on my recent sexual encounters with your family, friends and pets". "Ok" he replied and sat back, listening patiently. After a full 30 minutes, I gave up and moved on to death threats. Finally, as I was detailing the various rectal mutilation techniques that I would apply to his dead parrots, he snapped.

Like a ferocious lion, he leaped up on his desk, pulled the above hat and glasses out of his back pocket, and roared! His nostrils flared and steamed and his voice seemed to issue forth straight out of their snorting depths: "SONNY, DON'T YOU KNOW WHO YOU'RE DEEEALING WITH!" He then double somersaulted off his desk, punctuating the landing with a screeching "BOOOOM!", before erecting himself in the above pose mere centimeters from my terrified face. It was then that I noticed the distinctive bulge of an M20B1 Super Bazooka tucked into his belt and under his shirt.

I can confidently say that, had I left home without my grappling gun and smoke grenades, I would now be dead.

I had to conceal myself while I made my escape. So, as he struggled to free the bazooka from his pants, I snap rolled toward the door while unclipping a smoke grenade from my utility belt. Hefting the device, I cocked my arm and hurled it at his face. It clocked him hard and true in the chops, granting me a few precious seconds while his vision blurred with tears and the air became translucent with spittle as he dropped f-bombs for Africa.

I let loose my own roar. Only my roar was actually more like a terrified scream. Well... if we're gonna get technical about it: I screamed in the manner of one who is having his testicles busted open with a nutcracker while simultaneously having his remaining genital equipment welded to his anus.

I ran out of his office and down the corridor screaming like my life depended on it — which I assure you, it did. If I had thought about it, I suppose I would have turned my head and screamed backwards to boost my speed. But I wasn't thinking straight.

Ronald McDonald** sprang from his office like a deadly switchblade poised for the kill. He dropped to one knee, switched the bazooka to full-auto and went for the head shot.

Lucky for me, he'd left the safety on, and I reached the end of the building just as he fumbled off the first rocket. I smashed out of the 3rd story window and grappled onto the next building, swinging out of harms way as he completely obliterated the top 4 stories of the computer science building...

Unfortunately, there were no witnesses as everyone in the building had their music up too loud to notice the commotion. Thus, me and Ron were forced to spend the rest of the semester carefully avoiding each other.


NOTE: It is vital for our children that the world hears this story, which is why I have petitioned Michael Bay to make this raving into a movie. Sign it here!

* Yes, this is the real name of the university I attended.
** Yep! I was lectured by the one and only.