Saturday, June 18, 2011

How to setup your Git environment from scratch

SERVER SIDE
sudo apt-get install git-core git-doc gitweb git-gui gitk git-email
git-svn git-daemon-run
git init
git add .
git commit
git clone --bare ./menucook menucook.git

get the repo
git clone ssh://inguansoftsvn/home/inguanzo/depo/menucook.git

How to create a remote branch
git push origin origin:refs/heads/web

workflow to deploy into the server
git rebase origin/web

prompt for snowleopard:
parse_git_branch() {
  git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1="\[\e[01;31m\]\w \$(parse_git_branch): \[\e[00m\]"

prompt for linux:
if [ "\$(type -t __git_ps1)" ]; then
    PS1="\w \$(__git_ps1 '(%s)$ ')"
fi

Saturday, June 11, 2011

clean apps from iPhone simulator

to clear out old iPhone simulator's applications :

  • delete the folder called iPhone Simulator from the Application Support folder contained in your home directory's Library folder. 
  • or selecting iOS Simulator --> Reset Content and Settings...

Sunday, June 5, 2011

eval is evil


eval for any objective should not be used, even for parsing JSON
passing strings to setInterval()setTimeout(), and the Function() constructor is, for the most part, similar to using eval()