Last active
August 4, 2022 19:00
-
-
Save Brandon-Lyons/e6fa63bd662856acd07e to your computer and use it in GitHub Desktop.
New mac setup for rails development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Apps that I use: | |
| Sublime Text: text editor | |
| script to install package control: | |
| import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0'; | |
| pf = 'Package Control.sublime-package'; | |
| ipp = sublime.installed_packages_path(); | |
| urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); | |
| by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read(); | |
| dh = hashlib.sha256(by).hexdigest(); | |
| print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) | |
| packages: all autocomplete, color sublime, better coffeescript, cucumber, dashdoc, erb autocomplete, erb snippets, guard, javascript snippets, less, rspec, sass, scss, sublime linter, git, git blame, gitgutter, pretty json, zsh, theme - one dark | |
| theme: IR Black http://colorsublime.com/?q=IR_Black | |
| settings: { | |
| "animation_enabled": false, | |
| "auto_complete_commit_on_tab": true, | |
| "color_scheme": "Packages/Colorsublime - Themes/IR_Black.tmTheme", | |
| "draw_white_space": "all", | |
| "font_size": 16, | |
| "highlight_line": true, | |
| "ignored_packages": | |
| [ | |
| "Vintage", | |
| ], | |
| "show_tab_close_buttons": true, | |
| "tab_size": 2, | |
| "translate_tabs_to_spaces": true, | |
| "tree_animation_enabled": false, | |
| "trim_trailing_white_space_on_save": false, | |
| "word_wrap": 80, | |
| } | |
| Dash: Instant access to documentation | |
| Chrome: extensions: AdBlock, PageSpeed Insights, 1Password, Clear Cache, Font Face Ninja, Measure Dimensions, ColorZilla | |
| Alfred: Easy app and file access without having to use the mouse | |
| Cinch: Windows 7 style window resizing | |
| Open Sublime from terminal https://gist.github.com/artero/1236170 | |
| .bash_profile setup: | |
| alias subl="sublime" | |
| alias z='zeus' | |
| alias pull='git pull' | |
| alias push='git push' | |
| alias commit='git commit -m' | |
| alias work='cd /workspace' | |
| alias tool='cd /tools' | |
| [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| git-dirty() { | |
| st=$(git status 2>/dev/null | tail -n 1) | |
| if [[ $st != "nothing to commit, working directory clean" ]] | |
| then | |
| echo "*" | |
| fi | |
| } | |
| export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)$(git-dirty)\[\033[00m\] $ " | |
| export EDITOR=subl | |
| if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi | |
| export PATH=/usr/local/bin:$PATH | |
| install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| install RVM: \curl -sSL https://get.rvm.io | bash -s stable | |
| install git: brew install git | |
| gems: | |
| rails | |
| zeus | |
| bundler | |
| ZSH theme: Bullet Train https://github.com/caiogondim/bullet-train.zsh | |
| .zshrc: | |
| if type brew &>/dev/null; then | |
| FPATH=$(brew --prefix)/share/zsh/site-functions:$FPATH | |
| autoload -Uz compinit | |
| compinit | |
| fi | |
| ZSH_DISABLE_COMPFIX="true" | |
| # If you come from bash you might have to change your $PATH. | |
| # export PATH=$HOME/bin:/usr/local/bin:$PATH | |
| # Path to your oh-my-zsh installation. | |
| export ZSH="/Users/brandonlyons/.oh-my-zsh" | |
| # Set name of the theme to load --- if set to "random", it will | |
| # load a random theme each time oh-my-zsh is loaded, in which case, | |
| # to know which specific one was loaded, run: echo $RANDOM_THEME | |
| # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes | |
| ZSH_THEME="bullet-train" | |
| # Set list of themes to pick from when loading at random | |
| # Setting this variable when ZSH_THEME=random will cause zsh to load | |
| # a theme from this variable instead of looking in $ZSH/themes/ | |
| # If set to an empty array, this variable will have no effect. | |
| # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) | |
| # Uncomment the following line to use case-sensitive completion. | |
| # CASE_SENSITIVE="true" | |
| # Uncomment the following line to use hyphen-insensitive completion. | |
| # Case-sensitive completion must be off. _ and - will be interchangeable. | |
| # HYPHEN_INSENSITIVE="true" | |
| # Uncomment the following line to disable bi-weekly auto-update checks. | |
| # DISABLE_AUTO_UPDATE="true" | |
| # Uncomment the following line to automatically update without prompting. | |
| # DISABLE_UPDATE_PROMPT="true" | |
| # Uncomment the following line to change how often to auto-update (in days). | |
| # export UPDATE_ZSH_DAYS=13 | |
| # Uncomment the following line if pasting URLs and other text is messed up. | |
| # DISABLE_MAGIC_FUNCTIONS="true" | |
| # Uncomment the following line to disable colors in ls. | |
| # DISABLE_LS_COLORS="true" | |
| # Uncomment the following line to disable auto-setting terminal title. | |
| # DISABLE_AUTO_TITLE="true" | |
| # Uncomment the following line to enable command auto-correction. | |
| # ENABLE_CORRECTION="true" | |
| # Uncomment the following line to display red dots whilst waiting for completion. | |
| # COMPLETION_WAITING_DOTS="true" | |
| # Uncomment the following line if you want to disable marking untracked files | |
| # under VCS as dirty. This makes repository status check for large repositories | |
| # much, much faster. | |
| # DISABLE_UNTRACKED_FILES_DIRTY="true" | |
| # Uncomment the following line if you want to change the command execution time | |
| # stamp shown in the history command output. | |
| # You can set one of the optional three formats: | |
| # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" | |
| # or set a custom format using the strftime function format specifications, | |
| # see 'man strftime' for details. | |
| # HIST_STAMPS="mm/dd/yyyy" | |
| # Would you like to use another custom folder than $ZSH/custom? | |
| # ZSH_CUSTOM=/path/to/new-custom-folder | |
| # Which plugins would you like to load? | |
| # Standard plugins can be found in $ZSH/plugins/ | |
| # Custom plugins may be added to $ZSH_CUSTOM/plugins/ | |
| # Example format: plugins=(rails git textmate ruby lighthouse) | |
| # Add wisely, as too many plugins slow down shell startup. | |
| plugins=(git) | |
| source $ZSH/oh-my-zsh.sh | |
| # User configuration | |
| # export MANPATH="/usr/local/man:$MANPATH" | |
| # You may need to manually set your language environment | |
| # export LANG=en_US.UTF-8 | |
| # Preferred editor for local and remote sessions | |
| # if [[ -n $SSH_CONNECTION ]]; then | |
| # export EDITOR='vim' | |
| # else | |
| # export EDITOR='mvim' | |
| # fi | |
| # Compilation flags | |
| # export ARCHFLAGS="-arch x86_64" | |
| # Set personal aliases, overriding those provided by oh-my-zsh libs, | |
| # plugins, and themes. Aliases can be placed here, though oh-my-zsh | |
| # users are encouraged to define aliases within the ZSH_CUSTOM folder. | |
| # For a full list of active aliases, run `alias`. | |
| # | |
| # Example aliases | |
| # alias zshconfig="mate ~/.zshrc" | |
| # alias ohmyzsh="mate ~/.oh-my-zsh" | |
| alias pull='git pull' | |
| alias push='git push' | |
| alias commit='git commit -m' | |
| alias addp='git add -p' | |
| alias log='git log --topo-order --graph --decorate' | |
| alias start_mothership="bin/spring stop && DISABLE_SPRING=true bundle exec rails s -p 5000 -b 0.0.0.0" | |
| autoload -Uz compinit && compinit | |
| export SLACK_THEME_SHELL_PROFILE='~/.zshrc' | |
| export EDITOR='subl -w' | |
| export PATH=/usr/local/bin:$PATH | |
| export PATH="/usr/local/sbin:$PATH" | |
| export PATH=$PATH:/Users/brandonlyons/gcp-scripts/bin | |
| export PATH="$HOME/.rbenv/bin:$PATH" | |
| eval "$(rbenv init -)" | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment