December 2011
18 posts
2 tags
Checking the javascript type
Enter in console…
typeof object
Object can be any variable, objects, functions, strings, whatever…just play around with it.
2 tags
Open file in NetBeans from Mac Terminal
alias nb='/Applications/NetBeans/NetBeans\ 7.0.1.app/Contents/MacOS/netbeans --open'
Insert above code to ~/.profile
You can open file from terminal with nb index.php
4 tags
Syntax Highlighting for Mac Vi
Run
sudo vi /usr/share/vim/vimrc
Insert.. syntax on "turns on highlighting
set ai "turns on auto indent
set nu "turns on line numbers
I am not setting syntax on and set nu as auto in the rc file.
Perfer to turn them on as needed.
3 tags
Multiple windows in vi
:sp (horizontal)
:vs (vertical)
CTRL+W hjkl or up, down, left right to move around.
2 tags
Quit Vi easy mode
Found myself stuck in Vi easy mode.
CTRL+L
:qa!
Quit without saving
3 tags
Open Terminal from Finder
Settings -> Keyboard -> Services -> New Terminal at Folder
(restart Finder with killall Finder if it doesn’t work)
3 tags
Setting Virtual domain with XAMPP for mac
Sudo Edit the file /Applications/XAMPP/etc/extra/httpd-vhosts.conf
Refer to the examples in the file.
Insert Include conf/extra/httpd-vhosts.conf into
/Applications/XAMPP/etc/httpd.conf
Edit /etc/hosts and insert an entry for your doman that points to 127.0.0.1
Edit: For Lion users, add ::1 for every localhost domain that you have. This will speed things up a lot!
source:...
4 tags
Git fetch, push and merge
Lets say you created a new branch called “testbranch” on remote.
git fetch orgin
To fetch data from remote to local.
git merge origin/testbranch
To merge new “testbranch” branch.
git push origin testbranch OR git push origin
testbranch:testbranch
Former is a shorthand, latter is simply saying to push local
testbranch to remote testbranch.
2 tags
Git Diff
git diff
Shows changes between unstaged files and last commit
git diff head
Similiar to git diff
git diff --cached
Shows changes between staged files and last commit
2 tags
Vsphere Client
Download vSphere Client from the vSphere Server:
http://{your-server-ip}
source: http://www.thegeekstuff.com/2010/06/vmware-vsphere-client-install/
4 tags
Installing Windows 7 with Virtual Box in Mac OS X...
Here I’m trying to run Windows 7 with Virtual Box on my Mac.
Normal installation works fine,
Creating the drives,
Installing the OS
Well, problem came when I tried to share folders with my Mac.
Have to install Virtual Box Guest addition add on to do that.
Well, nothing happens when I clicked “Install Guest Additions…”
under Devices of VB menu. (You have to be running...
1 tag
Installing Kohana 3.2
If you’re getting this error:
HTTP_Exception_404 [ 404 ]: Unable to
find a route to match the URI: kohana-3.2 Check that your base_url is set eg:
Kohana::init(array( 'base_url' => '/kohana-3.2/', ));
3 tags
Installing xdebug with XAMPP on Mac
Follow instructions from http://xdebug.org/find-binary.php
to get the correct version of xdebug.
However, compile it with 32bit else you will find yourself trapped
with wrong architecture error.
./configure --enable-xdebug --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config CFLAGS="-arch i386 $CFLAGS" CCFLAGS="-arch i386 $CCFLAGS" CXXFLAGS="-arch i386 $CXXFLAGS" LDFLAGS="-arch i386...
1 tag
My new .profile
A shorter and more colorful prompt
#the prompt
#export PS1="\u@\h\w--\d--\t$"
alias gitbs="git branch | grep '^* ' | awk '{print \$2}'"
alias gitprompt="git status -s 2>/dev/null >&2 && echo \"(\`gitbs\`) \""
colorlightblue="\[\033[0;34m\]"
colorlightgreen="\[\033[0;32m\]"
colorred="\[\033[0;31m\]"
endcolor="\[\033[m\]"
export PS1="${colorlightgreen}\w${endcolor}"
PS1="$PS1...
5 tags
Common ports
HTTP
Port 80
FTP
Port 21
SSH
Port 22
5 tags
Install swftools Mac / Linux
Mac
Use Macports to install on Mac
However, use sudo port install foo configure.compiler=llvm-gcc-4.2
to install if you’re on lion os.
Check out the problemhotlist if you still encounter problems.
source: https://trac.macports.org/wiki/ProblemHotlist Linux
source:
http://www.betaquest.com/2010/08/how-to-install-swftools-0-9-1-on-centos-5-5/
Follow the steps and pray that it works.
2 tags
Listing all installed packages in Mac
source: http://forums.macrumors.com/showthread.php?t=817008 pkgutil --pkgs
3 tags
Setting up proftpd with mysql authentication
source:
http://heker86.wordpress.com/2008/10/21/how-to-install-and-configure-proftpd-with-integrate-the-mysql/ http://en.gentoo-wiki.com/wiki/ProFTPD/MySQL#Use_flag
The second link is secondary. Basically just to add a log file for sql
logs.
Most steps in link 1 is valid. Except for # create a user's home directory on demand if it doesn't exist SQLHomedirOnDemand on
Use # create a user's home...