This gist has been created using OSX Mavericks, but it sould work with any OSX 64-bits system – Mountain Lion, Mavericks and for sure Yosemite ;) In case that you are using a OSX 32-bits system OSX Lion or Snow Leopard (OSX Leopard is not supported by XCode) just include the 32-bits System? section.
OS X Mountain Lion, Mavericks & Yosemite are full 64-bit systems so lets configure them to ensure that incoming user's package installations (e.g., Homebrew package installations) will be on a 64 bits system and taking precedence over OSX packaged binaries.