Also don't forget HOMEBREW_NO_ANALYTICS=1 in your environment to keep it from silently phoning home a machine-specific unique identifier and your client IP (city-level geolocation) to Google every time you run it.
https://github.com/Homebrew/brew/issues/142