Thursday, October 18, 2012

Clear input field on focus

Here is a simple way to clear html input field on focus.
<input type="text" 
onblur="if (this.value=='') 
onclick="if (this.defaultValue==this.value) this.value=''" 
value="Replace this with your value" 

Saturday, October 6, 2012

Wordpress front end editor

Ever got a requirement of retrieving customer submitted data and storing it into your post, page or custom post type in Wordpress.

Well, there is a simple editor function wp_editor() is available within wordpress.

Sunday, September 30, 2012

DIY Multi Touch Technology

Ever imagined yourself in the future of user immersed technology to pave utmost user experience. Here, comes the multi touch technology for geeks.

First let's review some of it's application. Because, a video speaks million words.

1. Multi touch DJing Mixing Desk or Holo Desk from Emulator

2. iBar - largest multitouch touchscreen

3. BendDesk: Multi-touch on a Curved Display

4. Reality touchscreen University of Groningen

5. Google Liquid Galaxy

6. BlenderTUIO: Test about finger based 3d manipulation

If you are like most of us, then will probably wondering; how the hell people in the world got such a wonderful thing. And, probably you want one, isn't it?

Here is how you can build one for yourself.

STEP 1. Join the online community of people who are busy in making their own Natural User Interface at

STEP 2. Get some Flash and Adobe After effects skill, because most of the application are built on these platforms. If you are on python then I would recommend you PyMT.

STEP 3. Get cameras and projectors to make your own prototype, you will get these information on

STEP 4. Give back to the community and share your views and findings.

STEP 5. Ask questions or help on the community, they will sure help you.

STEP 6. Implement on live applications for your personal or professional usage.

Wednesday, September 26, 2012

Best mobile simulator for website

I came across few iPhone simulator which are merely an iframe running in smaller resolution to check the mobile compatibility of the site.

This method is not capable of checking the website which detects user agent and paves the website according to the device.

Another, method is to change the user agent of the browser and trick the website to show up as it should look on the mobile phone or any other device.

For example, my default user agent is set to :

Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1215.0 Safari/537.2 AlexaToolbar/alxg-3.1

Well, the above string shows that I'm using windows NT device and installed Mozilla, Safari(AppleWebkit) and Chrome - including other stuff.

Monday, September 24, 2012

Move data from one post type to another using SQL

There are many instances where you want to move the data from one post type to newly created post type in wordpress. For this you can use following simple SQL query.

UPDATE wp_posts SET post_type = 'new-post-type' WHERE post_type =  'post'

Wednesday, September 5, 2012

Modify title tag using wp_title filter

Here is a quick snippet to modify title tag for page, post, category using wp_title hook.

  add_filter('wp_title', 'modify_title', 20);
  function modify_title($title) {
    return $title . ' foo';