22 12 / 2011

Checking the javascript type

Enter in console…

typeof object

Object can be any variable, objects, functions, strings, whatever…just play around with it.

20 12 / 2011

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

Tags:

Permalink 1 note

19 12 / 2011

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.

19 12 / 2011

Multiple windows in vi

:sp (horizontal)
:vs (vertical)

CTRL+W hjkl or up, down, left right to move around.

19 12 / 2011

Quit Vi easy mode

Found myself stuck in Vi easy mode.

CTRL+L
:qa!

Quit without saving

19 12 / 2011

Open Terminal from Finder

Settings -> Keyboard -> Services -> New Terminal at Folder

(restart Finder with killall Finder if it doesn’t work)

19 12 / 2011

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: http://stackoverflow.com/questions/6841421/mac-osx-lion-dns-lookup-order

127.0.0.1 localhost
::1 localhost

Have to create a localhost domain when you are using virtual domains.

This is the default:

<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/htdocs"
ServerName localhost
ErrorLog "logs/error_log"
CustomLog "logs/access_log" common

<Directory "/Applications/XAMPP/htdocs">
Options -Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

18 12 / 2011

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.

16 12 / 2011

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

Tags:

Permalink 3 notes

13 12 / 2011

Vsphere Client

Download vSphere Client from the vSphere Server:

http://{your-server-ip}

source: http://www.thegeekstuff.com/2010/06/vmware-vsphere-client-install/