Skip to content

Instantly share code, notes, and snippets.

@revans
Last active December 9, 2019 20:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save revans/c37fdcb6751fc3c5f9bfd86bba72ccb9 to your computer and use it in GitHub Desktop.
Save revans/c37fdcb6751fc3c5f9bfd86bba72ccb9 to your computer and use it in GitHub Desktop.
# Copy this to your ~/.bash_profile
# for git
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# git autocomplete
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
export PS1='\u \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '
export MANPATH=/usr/local/git/man:$MANPATH
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
export PATH="~/npm-global/bin:$PATH"
# if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export PATH="$HOME/.rbenv/bin:$PATH"
source ~/.bashrc
#!/usr/bin/env bash -ex
#
# NOTES:
#
# To run this on your local machine (only if a new machine that has not been setup before), do the following:
#
# bash <(curl -Ls https://gist.githubusercontent.com/revans/c37fdcb6751fc3c5f9bfd86bba72ccb9/raw/3dcdd9a3246cc70b3829785328e03427165e2c44/brewfile.sh)
#
msg() {
echo "==> Installing ${1}..."
}
RUBY_VERSION=2.6.4
# Install Homebrew
msg "Homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Git
msg "Git"
brew install git
# Install Rbenv
msg "Rbenv"
brew install rbenv
# Update the ~/.bash_profile
echo "alias ll='ls -la'" > ~/.bash_profile
echo "alias hc='heroku run --size=Private-S rails console --app'" > ~/.bash_profile
echo 'eval "$(rbenv init -)"' > ~/.bash_profile
source ~/.bash_profile
# Install Ruby
msg "Ruby Version ${RUBY_VERSION}"
rbenv install $RUBY_VERSION
rbenv global $RUBY_VERSION
source ~/.bash_profile
# Install Rubygems
msg "Bundler"
gem install bundler
# Install heroku toolbelt
msg "Heroku Toolbelt"
brew tap heroku/brew && brew install heroku
# Install Freetds
msg "Freetds"
brew install freetds
# Install Nodejs
msg "Nodejs"
brew install nodejs
# Install Redis
msg "Redis"
brew install redis
# Install Mysql
msg "MySQL"
brew install mysql
# Install PostgreSQL
msg "Postgresql"
brew install postgresql
brew services start postgresql
# Install Graphviz
msg "Graphviz"
brew install graphviz
# Install ODBC
msg "UnixODBC"
brew install unixodbc
# Ensure that the ~/.bundle/config file has the Sidekiq Credentials stored in `BUNDLE_GEMS__CONTRIBSYS__COM`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment