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. ]




February 27, 2008

RTL8187B update; Miscellany

10:08 am — Code, Geek, Linux, Misc, laptop, usmc

I’ve put up the contributed version of the RTL8187B driver I received from a Mister Adams that supposedly works with the 2.6.24 kernel. Note I haven’t tried it yet (I’m not in a hurry to upgrade from 2.6.22, even with that local exploit going around), and the only other person I sent it to reported a kernel panic. Use at your own risk.

Also, I was lucky enough to get called up to be in the Holiday Bowl Parade in San Diego in 2007. This was pretty much the only picture I could find (that’s me in the back):

If anyone else happened to be there and snap a couple, think you could send ‘em my way?




February 7, 2008

Laaaaaaaaaaag

9:29 pm — Misc, meta, stuff that sucks

Sorry, I know I’ve been lagging lately. I broke up with my girlfriend, moved out, and then the friends I’ve been staying with moved. Everything should be returning somewhat to normal soon. (The new place has many neighbors with open wireless. ;-))