jQuery: jquery-tmpl nje, get string from template

September 3rd, 2010 by jeremychone | No Comments »
var tmplFn = $( "#myXmlTmpl" ).template();
var xml = tmplFn($,{data:myData}).join("");

jQuery: Get the full string of a html element with outerHTML

September 3rd, 2010 by jeremychone | No Comments »
var fullElementHtml = $('#myElement')[0].outerHTML;
//or, the same
fullElementHtml = $('#myElement').attr("outerHTML");

Tomcat: Installing mod_jk with Apache on Linux

August 27th, 2010 by jeremychone | No Comments »

1) Download Mod_JK

2) Copy it in the /etc/httpd/module as jk_module.so

3) Add the following in the /etc/httpd/httpd.conf

LoadModule jk_module modules/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info

4) Have the following in workers.properties

worker.list=workerD,worker81

#workerD (default) 8080
worker.workerD.type=ajp13
worker.workerD.host=localhost
worker.workerD.port=8009

worker.worker81.type=ajp13
worker.worker81.host=localhost
worker.worker81.port=8109

Simple WebApp to create mock data

August 25th, 2010 by jeremychone | No Comments »

http://www.generatedata.com/#generator

Xcode: adding folder path to access bundle files (iOS)

August 24th, 2010 by jeremychone | No Comments »

Source: BenODwyer

Creating a “Group” in XCode doesn’t create a real Directory within your app Bundle.

You need to import the directory into your app using the following method:

Create a Directory on your Mac.

Select to Add Existing Files to your project

Select the Directory you want to import

In the pop-up window make sure you select “Copy items into destination group’s folder” and “Create Folder References for any added folders”

Hit “Add”

Your done!

The Directory should appear blue instead of yellow.

Now try your code:

Code

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"w1" ofType:@"geo" inDirectory:@"part1"];

Pics: Great Photoshop Free downloads

August 22nd, 2010 by jeremychone | No Comments »

http://www.graphicsfuel.com/

OSX: Set Mac hostname (i.e. avoid perforce workspace issues)

August 17th, 2010 by jeremychone | No Comments »

To set the hostname of your Mac, do:

sudo scutil --set HostName myhostname.local

To check your hostname:

hostname

Source: Change the hostname in a Mac

This is particularly useful when using perforce from different location. Perforce link a hostname to a workspace, and OSX seems to take the hostname based on the network (in some occasions). So, you can end up with an error like:
Client ‘jeremy_MBPro_4′ can only be used from host ‘dyn105.sm1.corp.agkn.net’.

OSX: Add autocomplete for git on Mac

August 17th, 2010 by jeremychone | No Comments »

in the home folder (~), edit (or create) the .profile file with the following

# Set git autocompletion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
  . /usr/local/git/contrib/completion/git-completion.bash
fi
GIT_PS1_SHOWDIRTYSTATE=true

if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
fi

PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '

Source GIT Autocomplettion and enhancement

OSX: Mac keyboard Shortcuts

August 16th, 2010 by jeremychone | No Comments »

Source: atmac.org - simple keyboard shortcuts

OSX: Java FAQ for Mac

August 16th, 2010 by jeremychone | No Comments »

http://developer.apple.com/java/faq/