/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
More installation information and options at: https://github.com/Homebrew/brew/blob/master/docs/Installation.md#installation.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Download the uninstall script and run ./uninstall --help
to view more uninstall options.