Moved from gist to repo

From: https://gist.github.com/hak8or/7798027

Fixed two typo's.