Thursday, August 29, 2013

Synchronous vs. Asynchronous [Node.js]

SYNCHRONOUS = waits for one line of code to finish before moving on to another task

  • example:  PHP 

ASYNCHRONOUS = moves on to another task before it finishes that line of code

  • example:  Node.js (asynchronous by default, sychronous can be forced with certain functions & callbacks)

Tuesday, August 27, 2013

Install .iso to VMware Fusion

  1. Download .iso of operating system (ubuntu desktop for this)
  2. Open VMWare > File > New
  3. "New Virtual Machine Assistant" 
    1. Create a custom virtual machine
    2. Continue
    3. Choose Operating System & Version
    4. Customize Settings (if you want to change1GB memory & 20GB storage defaults)
  4. VMware will attempt to boot from CD and then fail
  5. Menu Bar > Virtual Machine > CD/DVD (IDE) > Choose Disc or Disc Image... > Select .iso file
  6. Menu Bar > Virtual Machine > CD/DVD (IDE) > Connect CD/DVD
  7. Wait about a minute for Operating System to start through VMware
  8. Install

This post is specifically for installing Ubuntu 12.04 into VMware Fusion 5.0 on Mac OSX without the CD/DVD Drive.

Friday, August 23, 2013

Javascript/Node Replace Space with Dash or Space

var phrase = phrase.replace(/\s+/g, '-');

var phrase = phrase.replace(/\s+/g, ');


Git Reset Remote Branch with Local Branch

Start New/Fresh Local Repository

Download Master Code

git clone

Create New Local Develop Branch & Switch to it (-b) 

git checkout -b develop

Force Overwrite (-f) Remote Develop Branch with Newly Created Local Develop Branch

git push -f github develop

This FORCES an overwrite of remote branch files while retaining commit history, NO merging.

Git Reset Local Branch with Remote Branch

git fetch --all
git reset --hard origin/branch
git fetch downloads the latest from remote without trying to merge or rebase anything. Then 
git reset resets the master branch to what you just fetched

This FORCES an overwrite of local files, NO merging.