Monday, June 18, 2012

Overriding window.open( ) in Javascript

Sometimes you may want override the window.open( ) in Javascript. It's strange, but you really it occasionally. Here is how we can do it:

var open_ = window.open;

window.open = function(url, name, opts) {
   return open_(url, name, opts);
}

Then you can add your own checking / modifications right before the window is opened.


Monday, June 11, 2012

ArcGIS JS: Move a graphic to top

To move a graphic in a ArcGIS JS GraphicsLayer to top:

g.getDojoShape().moveToFront();

But this may breaks the onClick event of the GraphicsLayer, beware.

Updated: in ArcGIS JS API version 3.8, use getShape( ) instead. ESRI... no more stupid naming please...



Friday, June 1, 2012

About OSX Lion's Apache

Just a quick notes on Lion's Apache information:

  1. Location of the httpd.conf: /etc/apache2/httpd.conf
  2. PHP: php5_module in httpd.conf
  3. Virtual hosts conf: /private/etc/apache2/extra/httpd-vhosts.conf (included in httpd.conf)
  4. Restart Apache: apachectl restart (requires root)

Sync multiple git repo at once

Use the following command in Linux will do the job:  ls -d RepoNames* | xargs -I{} git -C {} pull