1. Earlier today I was trying to upload an app to the web for download as enterprise app.
    But first, the .plist file needs to be hosted on a https server.

    So I enabled Apache SSL default SSL configuration with a2enmod ssl and `service a2ensite` default-ssl (something like that) then restart the server.

    HTTPS worked. So I moved all the files in enterprise folder to /var/www/ssl.

    Finally was not getting some certificate error when clicking on the download link in the enterprise site, but the app couldn’t be downloaded. I move the .plist to be hosted in S3 since they have HTTPS by default, and wasted quite a lot of time and found out that the .ipa file cannot be in the HTTPS site. I think it might be due to the self-signed SSL.

    Moved the .ipa file out of the SSL folder, and it finally downloads.

    The .plist URL field should also be modified to the full URL pointing to the .ipa file. http://domain.com/enterprise/myapp.ipa for example.

     

  2. Checking the javascript type

    Enter in console…

    typeof object

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

     

  3. 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. 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.

     

  5. Multiple windows in vi

    :sp (horizontal)
    :vs (vertical)

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

     

  6. Quit Vi easy mode

    Found myself stuck in Vi easy mode.

    CTRL+L
    :qa!

    Quit without saving

     

  7. Open Terminal from Finder

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

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

     

  8. 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>
     

  9. 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.

     

  10. 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