Skip to content

Instantly share code, notes, and snippets.

@JeffreyMFarley
Last active December 26, 2023 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffreyMFarley/33e158f03d1d6647155a3338380952df to your computer and use it in GitHub Desktop.
Save JeffreyMFarley/33e158f03d1d6647155a3338380952df to your computer and use it in GitHub Desktop.
Set up laptop
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/farley/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="bullet-train"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# An empty array 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 change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# 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? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-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
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
# export MANPATH="/usr/local/man:$MANPATH"
export CDPATH=.:~/dvp
# 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"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# 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 bot=~/bin/bot.sh
alias di="docker images"
alias finder-here="open -a Finder ."
alias barehist="history | cut -c 7-"
alias count-types="find . -type f | sed -n 's/..*\.//p' | sort | uniq -c"
alias dcu='docker-compose up --abort-on-container-exit --attach-dependencies && docker-compose down'
alias ddf='docker system df -v'
alias pick-vn='paste -d " " <(python ~/dvp/naming-is-hard/pick.py verb 30) <(python ~/dvp/naming-is-hard/pick.py noun 30) | sort'
# https://github.com/caiogondim/bullet-train.zsh
BULLETTRAIN_PROMPT_ORDER=(
time
virtualenv
nvm
dir
git
)
#BULLETTRAIN_DIR_EXTENDED=0
BULLETTRAIN_GIT_COLORIZE_DIRTY=true
# Python Virtual Envs
# export WORKON_HOME=$HOME/.virtualenvs
# source /usr/local/bin/virtualenvwrapper.sh
# Node
source $(brew --prefix nvm)/nvm.sh
#!/bin/sh
# Prepare the Mac Finder
chflags nohidden ~/Library
defaults write com.apple.finder AppleShowAllFiles YES
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
# Create a space for projects
# Have brew install everything
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
## curl brewfile > ~/Brewfile
brew bundle install
# Change the shell
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
chsh -s /bin/zsh
#!/bin/bash
# -----------------------------------------------------------------------------
# Resetters
clean() {
docker image prune -f
return $?
}
melt() {
scour
docker volume prune -f
}
nuke() {
melt
docker image prune -f --all
}
scour(){
docker stop $(docker ps -a -q)
docker container prune -f
clean
docker builder prune --all
}
# -----------------------------------------------------------------------------
# Helpers
build() {
docker-compose build $1
return $?
}
run() {
docker-compose up --abort-on-container-exit --attach-dependencies --remove-orphans $1
docker-compose down
}
# -----------------------------------------------------------------------------
case $1 in
brun)
clean && build $2 && run $2
;;
build)
build $2
;;
clean)
clean
;;
melt)
melt
;;
nuke)
nuke
;;
run)
run $2
;;
scour)
scour
;;
*)
echo "Usage: $0 {command}"
echo " clean - remove extra images created by docker"
echo " scour - remove all containers from the machine"
echo " melt - remove all containers and volumes from the machine"
echo " nuke - remove everything"
echo " --------------------------------------------------------------------"
echo " brun - build then run all services"
echo " build - build all services"
echo " run - start all services"
echo " + <service> - build or run just one service"
exit 2
;;
esac
cask_args appdir: '/Applications'
tap 'homebrew/bundle'
tap 'homebrew/cask-fonts'
brew 'autoenv'
brew 'docker'
brew 'docker-compose'
brew 'docker-machine'
brew 'gcc'
brew 'git'
brew 'graphviz'
brew 'jq'
brew 'netcat'
brew 'node'
brew 'nvm'
brew 'openssl'
brew 'pyenv'
brew 'tree'
brew 'zsh'
cask 'db-browser-for-sqlite'
cask 'dropbox'
# cask 'firefox'
# cask 'gimp'
cask 'google-chrome'
cask 'microsoft-office'
cask 'slack'
cask 'visual-studio-code'
cask 'font-roboto-mono'
cask 'font-roboto-mono-for-powerline'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment