Posts filed under ‘geeky’
DodosMail upgraded
November 23rd, 2006
i addded captcha spam protection support to DodosMail and it’s now version 2.5. i highly recommend you upgrade your old scripts for better security protection. to upgrade, simply replace your old dodosmail.php with the new one. if you want to use the new captcha feature, check the readme.txt and captchaTest.php.
What happened to the design?
April 5th, 2006
To know more about why styles are disabled on this website visit the
Annual CSS Naked Day website for more information.
label IDs and input effects
March 25th, 2006
this is nothing new but i didn’t learn about it until yesterday and it totally made my day. basically if you use code like:
<label for="checkme">Check me:</label> <input type="checkbox" id="checkme"/> <br /> <br /> <label for="radio1">Radio 1:</label> <input type="radio" id="radio1" name="something" value="on"/> <label for="radio2">Radio 2:</label> <input type="radio" id="radio2" name="something" value="off"/>
clicking on the corresponding label text will check/uncheck the checkbox & radio buttons for you.
as long as the label for attribute matches the id attribute inside of the input tag, clicking on the text always have some type of effect on the input field. mostly just set the focus on the input field. the coolest ones are the checkbox and the radio buttons as you can see in the example.
wp lightbox plugin (make css validate)
March 20th, 2006
wee - i installed this really cool
lightbox wordprerss plugin. it overlays photos in your wordpress. it’s so awesome. the girl in this photo is a chinese singer named rainie yang. if you wish to hear some of her songs,
go here.
inline binary data display
March 12th, 2006
would it be nice that all browsers can handle inline binary data display? actually just images will be fine. so no more image uploading.. just do something like:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAFSDNYfAAAAaklEQVR42u3XQQrAIAwAQeP%2F%2F6wf8CJBJTK9lnQ7FpHGaOurt1I34nfH9pMMZAZ8BwMGEvvh%2BBsJCAgICLwIOA8EBAQEBAQEBAQEBK79H5RfIQAAAAAAAAAAAAAAAAAAAAAAAAAAAID%2FABMSqAfj%2FsLmvAAAAABJRU5ErkJggg%3D%3D" alt="" />
demo:
this particular line is supported in firefox, safari and konqueror but not IE (yet). I will try out IE 7 next week. to read more interesting stuff about finding the limits in web browsers, learn about the acid2 test.
edit: found a very unpretty way to embed inline images in IE but bow to the author who made it work.
time calculator
February 26th, 2006
i had to add some time in hh:mm:ss format at work. i was like there was no way i would add those manually. so i looked for a program/script to do the work. since i didn’t find anything, i wrote my own.
the most time consuming part is not the addition (which is very easy) but the frontend javascript to move the cursor & insert 10 more rows when the link is clicked. those were fun to write 
geeky t-shirts
February 18th, 2006
i’m browsing online geeky t-shirt stores out of boredom.
here are some of the entertaining ones i’ve seen:













heard another here i like:
“SELECT * FROM users WHERE clue > 0
0 rows returned”
disable wordpress smiley for a certain post/page
February 2nd, 2006
okie, i thought someone has figured it out by now. but when i asked on the wordpress board, i got no response. so i digged around and figured a hack for it.
i noticed sometimes esp. on some pages, the smiley conversion does a poor job and converts the wrong text into smilies. it really mars my content. personally i want to be able to just turn the smiley off for a certain post or page.
the best way i can think of to do it is via a hack.
open your wp-includes/functions-formatting.php file, try find the function (possibly line 576):
function convert_smilies($text) {
then under it, replace:
global $wp_smiliessearch, $wp_smiliesreplace; $output = ''; if (get_settings('use_smilies')) {
with:
global $wp_smiliessearch, $wp_smiliesreplace, $post; $output = ''; $smileykey = get_post_meta($post->ID, "disable_smiley", TRUE); if (get_settings('use_smilies') && $smileykey != 'true') {
that’s all i needed to do.
now next time you write a new post/post, simply create a custom field with the key disable_smiley and value true to disable smiley conversion for just that post/page. isn’t that neat? 
rel=”external”
February 2nd, 2006
for those who did not know this trick (someone emailed me and asked), I will share it with you here. since xhtml 1.0 strict does not allow the tag target=”_blank” you can still open links in new windows by using the tag rel=”external” to accomplish the same thing. but you will need to link an external js.
create a .js file with the content
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
}
}
window.onload = externalLinks;
save & upload it. then link it in your header like any other external javascripts. that’s all 
XHTML strict validated flash code
February 1st, 2006
i put up a slideshow of the silver jewelry club photos i’ve saved. after i added the code given to me directly from slide.com, my site no longer validates with XHTML 1.0 strict rules. So I researched on valid flash embed code and found this nifty javascript trick for embedding flash.
The code given to me from the slide.com:
<embed src="http://widget.slide.com/widgets/slideticker.swf" quality="high" scale="noscale" salign="l" flashvars="site=widget.slide.com&channel=181375" wmode="transparent" bgcolor="#f5f5f5" width="205" height="97" name="flashticker" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
The final code I put up that works & validates:
<div id="slideshow">If you don't see the slideshow, <a href="http://www.flickr.com/photos/68167759@N00/">click here.</a>.</div> <script type="text/javascript"> // <![CDATA[ var fo = new FlashObject("http://widget.slide.com/widgets/slideticker.swf?site=widget.slide.com&channel=181375", "flashticker", "205", "97", "6", "#ffffff"); fo.addVariable("wmode", "transparent"); fo.addVariable("quality", "high"); fo.addVariable("scale", "noscale"); fo.addVariable("salign", "l"); fo.addVariable("align", "middle"); fo.write("slideshow"); // ]]> </script>
given that I’ve properly uploaded flashobject.js and included in the header of my HTML with:
<script type="text/javascript" src="/js/flashobject.js"></script>

