Wednesday, October 10, 2012

Include jQuery in the Browser JavaScript Console

To play around with jQuery in your browser's JavaScript Console, copy and paste the following lines!
var jq = document.createElement('script');
jq.src = "";

Thursday, July 12, 2012

Using changelist for SVN

Changelist is useful for organizing your code changes when you're working on more than one projects. You can mark files with different changelist flags to keep them organized.

For example, we changed three files for ticket 66, and then commit them all together later:
$ svn changelist ticket66
Path '' is now a member of changelist 'ticket66'.
Path '' is now a member of changelist 'ticket66'.
Path '' is now a member of changelist 'ticket66'.
$ svn status
A       test/

--- Changelist 'ticket 66':
$ svn commit --changelist ticket66 -m "Fixing ticket 66."
Transmitting file data ...
Committed revision 2.

Wednesday, May 9, 2012

Integer validation in JavaScript

function isInteger(val) {
    var intRegEx = /\D/g;
    return (!intRegEx.test(val));

Tuesday, March 20, 2012

Request the parent window to open a URL from an iframe with different domains

Sometime we are developing something within an iframe, but we want the parent window to refresh or open a URL. The code to use is:
top.location.href = URL;

Thursday, March 8, 2012

SVN commands

Create a patch
svn diff > ~/fix_ugly_bug.diff

Apply a patch
patch -p0 -i ~/fix_ugly_bug.diff

Monday, March 5, 2012

Text lineup using html span tag

<style type="text/css">
span {
  display: inline-block;
  width: 50px;

Tuesday, January 31, 2012