What I did on my vacation from reality

Home About RTL8187B Laptop Cam Quotes Login

October 4, 2008

Fun with Javascript

3:03 pm — Code, Main, Misc

I made a few improvements to the site. (Yes, I know those Javascript popups from you people trying to download the RTL8187B drivers while I was trying to debug were probably pretty god damn annoying. Sorry. I set up a testbed on my laptop so I won’t have to debug here any more.)

One of the neater things I came across was Lightbox, which is a really spiffy image viewer. The real fun came when I decided that I didn’t want the image actually rendering anywhere on the page. :-) Easy enough, and two ways to do it. The first is to write an anchor tag (with foo = document.createElement(’a')) and setting its style.display to “none”. (Make sure you set all the other attributes, also. The most important are rel="lightbox" and href="whatever image you’re displaying.) Then just have your script call myLightbox.start(foo) when your conditions are met and you want it to display the image.

The other way to do it is to actually write out all the HTML manually: e.g., <a href="/~cuervo/goatse/goatse/hello.jpg" rel="lightbox" id="goatseLink" style="display: none;"></a> <a href="javascript:myLightbox.start('goatseLink')">Open wide!</a>

Obviously, you can use whatever you want instead of an anchor tag pointing to myLightbox.start().

Another thing I was playing around with (mostly for the sake of relieving boredom, and because I hadn’t done it in a while) was AJAX, loading HTML into the page with another HTTP request after the page had already loaded. While I was doing that, it occured to me that it would make a good anti-spam technique: if you’ll notice, spam bots tend not to know about Javascript. It’s a pretty commonly proposed way to obfuscate addresses (although I’ve never seen it done, but I might have just not been paying close enough attention).

Anyway, here’s some Javascript to make life easy, mostly the usual muck with a few extra lines. Just load it in, create an HTML element with id="divName, then call ajaxSetDiv('divName‘, ‘some URL‘); and the rest takes care of itself.

[ Edited 2009-01-28 for typos. ]




July 12, 2008

Fun with military ID

6:11 pm — Code, Geek, Linux, Stuff, perl, usmc

So, being in the military, I get one of these nifty little dealies. I never bothered to look into them, but I saw a USB reader for $25 when they shipped us out for training, so I figured, what the hell.

I haven’t bothered to get really into smartcard hacking (yet?), but I have got it locking and unlocking my screen (and other assorted fun things when my friends plug their cards in).

Source - requires Chipcard::PCSC




February 27, 2008

Found it! WTF, Twitter? And the new RTL8187B driver

8:16 pm — Code, Geek, Linux, laptop, twitter, usmc

Okay, I finally found a decent picture of me in that parade. Yay.

(That’s me in the back.)

Twitter’s fucking down again, which is too bad, because I just wrote a mail handler to tell me who’s following me. Woot, looks like it just came back up.

And, finally, I need reports on the new version of the RTL8187B driver that Mister Adams sent me, please. Does it compile? Does it work? Does it turn your computer into Oprah?