The Dopefly Tech Blog

<< The Dopefly Tech Blog Main page

Programmers, Prepare Your Pranks!

posted under category: General on March 30, 2005 at 1:00 am by MrNate

As a friendly reminder that April Fool's Day is just around the corner, and better yet, it's a weekday, for those of you who run any intranets, here's a little code to get you going. Just a simple little trick, but it gets the job done. Click below to view it (just a little CF, mostly Javascript).

<cfif not dateCompare(now(),"4/1/#year(now())#","d")>
var r = Math.round(Math.random()*100);
function dang() {if(r==25){document.bgColor=getRandColor();setTimeout("dang();",50);}}
function getRandHex() {var b16=new Array(1,2,3,4,5,6,7,8,9,'a','b','c','d','e','f');return b16[Math.floor(Math.random()*15)];}
function getRandColor() {var c="";while(c.length<6){c+=getRandHex();}return c;}

Try it out. Doesn't do anything? There's a 1% chance that it will, but once or so out of a hundred hits, you'll get a random color flashing page background. Refresh and it's gone! Pretty sneaky, no?

Too old to comment!
On Mar 30, 2005 at 1:00 AM Rob (rbils whose domain rhymes with said:
I was planning to replace our intranet's home page with a gizoogled version for people with certain IP addresses), but our content filter (websense) just started blocking the gizoogle site!!!

On Mar 30, 2005 at 1:00 AM Nathan Strutz ( said:
One more thing, pasting tags in the comments just turns out like crap, sorry, I'll get to it someday.

Put your tricks on your own blog, or mail them to me and I'll put the good ones up. Thanks, all!

On Mar 30, 2005 at 1:00 AM Rob (rbils at the ever popular said:
My other favorite thing to do is find people around the office with unlocked computers whent they are away from their desks and modify their windows HOSTS file. I simply point some of their favorite sites to other IP addresses/sites. Very funny to watch.

On Mar 31, 2005 at 1:00 AM Eric Moritz ( or or said:
Of coarse there are the classic pranks:
1. Change there keyboard layout to dvorak
2. Take a screen capture of their desktop and hide all there icons
3. Map internet explorer to the format command
etc etc etc...
Too old to comment!