Friday, April 10, 2009

Loading rails project using irb

You can load rails project in irb. for instance in your rail's project directory you start irb. Then you only need to require environment.rb file. Such as require 'config/environment.rb' in irb and thats it now you can access your project's model, etc.

Thursday, April 9, 2009

Bookmark in Firefox and Internet Explorer

Add this function into your head tag and call it. This works for both Firefox and Internet Explorer.

function add_to_fav(title, url){
if(document.all)
{
window.external.AddFavorite(url, title);
}
else if(window.sidebar)
{
window.sidebar.addPanel(title, url, "")
}
}

and call like this; add_to_fav('My blog', 'http://raza-ali.blogspot.com/')

Duplicate content of Ajax call using facebox with jQuery in Internet Explorer

Problem: In Internet Explorer 7, populating once facebox lightbox using Ajax call works fine but if I repeat that calls it starts duplicating the content of the lightbox, gave impression that it appends new call at the end of already populated content and only doing hide and show of the lightbox content.

Solution: After debugging I noticed that in my Ajax call I am calling a whole web-page including HTML and BODY pair tags. So removing HTML tags and only fetching relevant DIV content solved my problem :)

Monday, April 6, 2009

run Multiple instances of Skype and Windows Live

running multiple instances of Skype;

Step1. Create a shortcut of Skype. Lets say on your Desktop. Mine Skype is installed on default location that is "C:\Program Files\Skype\Phone\Skype.exe".
Step2. Right click on the new shortcut and there you find a Target field with value "C:\Program Files\Skype\Phone\Skype.exe". Add /secondary switch at the end with space before and outside quotes. so it looks like. Target:
"C:\Program Files\Skype\Phone\Skype.exe" /secondary. and thats it.

Now double click on this icon and this will start a new Skype instance.


running multiple instances of Windows Live messenger;

Step1. Click on start -> run.
Step2. type "regedit"
Step3. Expand the tree, such as; HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Live\Messenger
Step4. Right -click on Messenger node and select New then DWORD (32-bit) Value.
Step5. Name that key MultipleInstances.
Step6. Right-click on that key and modify it with value 1, with Base Hexadecimal.
Step7. Execute Windows Live messenger from start->programs->windows live->windows live messenger.

Thats it now you can run multiple Live messenger instances.