Git GUI checkout single file command

January 31, 2011

To checkout a single file using Git GUI, go to the Tools menu and add the following command
git checkout $REVISION -- $FILENAME
Now select the file to checkout and run the command .

See Stack overflow post about this here – http://stackoverflow.com/questions/1507300/git-checkout-revision-of-a-file-in-git-gui


Difference between Div and Span tag

January 27, 2011

Good article in the link below about this
http://webdesign.about.com/od/htmltags/a/aa011000a.htm

Simple point to keep the difference in your mind is Div tag adds new line , Span tag does not


Convert JSON Object to String javascript

January 26, 2011

you can user browser native function JSON.stringify to do this

var foo = {};
foo.bar = "new property";
foo.baz = 3;

var jsonString = JSON.stringify(foo);

https://developer.mozilla.org/En/Using_JSON_in_Firefox

And IE8 also supports it – http://blogs.msdn.com/b/ie/archive/2008/09/10/native-json-in-ie8.aspx


jQuery Template plugin html in variables

January 25, 2011

If you pass html content in the template variables, you have to use {{html ..}} format to make sure that the html content gets converted into real html elements.

See this Stack overflow post http://stackoverflow.com/questions/4570222/htmlentities-equivalent-in-jquery-template-plugin

And this documentation – http://api.jquery.com/template-tag-html/


Javascript code equivalent to java i18n MessageFormat

January 25, 2011

Here is a Stack overflow post with javascript regex solution for this problem.

http://stackoverflow.com/questions/1353408/messageformat-in-javascript-parameters-in-localized-ui-strings


Handling cookies with java URLConnection

January 17, 2011

http://www.hccp.org/java-net-cookie-how-to.html

Same way you can set other headers like Content-Type, Accept to the HTTP request using the setRequestProperty method of URLConnection


Firefox addon to build HTTP request

January 17, 2011

http://stackoverflow.com/questions/725998/are-there-firefox-extension-or-any-other-browser-that-allow-to-send-arbitrary-p

This needs comes up when you cannot test build HTTP GET or POST request requiring special request headers like content type = application/json;