Sometimes it’s the most basic things that make me wonder. In this case, I was trying to figure out the best way to determine that an argument had not been passed to a function. That is, we have a function that expects function(one, two), but someone might invoke it with function(one). And we’d like to know that fact within the function, perhaps to set some default values. Continue reading
Undefined Arguments in JavaScript
This post was sent via Posterous
This post came from my Android
I’m using the WordPress app for Android. The purpose of this post is simply to test this out. I have a client that would like to photo-blog from his iPhone, so I thought. I might check out the possibilities. I might instead rig something up with Posterous.
Custom Styles for Google Maps
I attended Google I/O 2010 this past week, and they announced that that the Google Maps API v3 is now able to be styled. Check out the announcement on the Google Blog. Here is my first experiment with it.
vCards as QR Codes with Google Chart API
Here is an example of a vCard turned into a UTF-8 encoded URL string. Once we encode it in this fashion, we can put it in a URL formatted for the Google Chart API that will generate a QR Code of the vCard data. Continue reading
Tarpipe: a cool idea for lifestreaming, but is it secure?
I decided to check out Tarpipe because it looks like the kind of information flow / lifestreaming thing I’ve been interested in developing for Posterous. Strangely, Tarpipe doesn’t support Posterous, but instead supports Tumblr. But I thought I’d try it anyway.
The creepy thing, however, is that I had to give my Twitter login info to Tarpipe to get this rolling. Continue reading
WordPress CMS: testimonials, custom fields, and random posts
Today I had to set up a way to organize and publish the content of customer testimonials. Excerpts from these testimonials were going to appear in the left column of the page, in addition to being able to viewed in their entirety. So the designer of the site and I both agreed they should be Posts, submitted within a Testimonial category.
On the page where the testimonial should appear, the client would have the option of getting a specific Testimonial to appear in the left column. However, if the client forgot to specify a Testimonial post, then a random testimonial would appear instead.
Here is the code that went in index.php… Continue reading
Sections of a WordPress Site
Sometimes it’s useful to know whether the current post or page is within a specified hierarchical section of the site.
For example, I may have a page on my site called “Super Funky”, and some child pages dedicated to James Brown, Sly Stone, Parliament-Funkadelic, etc. On these pages, I have some special code that prevents them from uncontrollably getting down on the dancefloor… but the question is, how do we set up the logic that will check whether we are within the Super Funky section of the site? Continue reading
Default WordPress Video
Some comparisons of the stock video functionality, using the “Add Video” button above the editing window in WP 2.8. Continue reading
YouTube Lightbox Embedding
Here is a YouTube Flash video player that is viewed within the ever-popular “lightbox effect”. To achieve this, I am using iBox, which is freely available as a simple JavaScript file or as a WordPress plugin. Since this is within my blog, I chose the WordPress version.
iBox allows me to use a link to a YouTube video. In this case, I wanted my link to look like a video clip, so I used Grab on my MacBook to get an image of the video player on my YouTube player test page.
That worked fine, but to prevent those “related videos” from popping up at the end of the playback, I had to edit the iBox JavaScript file. Basically, I had to update the HTML string that would be dynamically added to the DOM to bring it inline with YouTube’s current recommendations for modifying the player. And then I had to tweak the player. Continue reading
