Skip to content

Instantly share code, notes, and snippets.

@wkirby
Last active November 4, 2020 08:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wkirby/7b6dd6bfbba452f5f1d061f13c47e5d7 to your computer and use it in GitHub Desktop.
Save wkirby/7b6dd6bfbba452f5f1d061f13c47e5d7 to your computer and use it in GitHub Desktop.
Apsis OSX Setup
# Node
nodesize() {
find . -name "node_modules" -type d -prune -print | xargs du -chs
}
nodenuke() {
echo "This command will recursively delete node_modules from your current directory."
echo "Continue (y/n)?"
read CONT
if [ "$CONT" = "y" ]; then
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
fi
}
# Docker
alias dc=docker-compose
alias dm=docker-machine
dockernuke() {
echo "› Nuking Docker container...\n"
docker-compose rm -fsv &&
docker-compose pull &&
docker-compose build --no-cache &&
docker-compose up --force-recreate
}
dockerstop() {
echo "› Stopping all Docker containers...\n"
docker stop $(docker ps -a -q)
}
dockerrm() {
echo "› Removing all Docker containers...\n"
docker rm $(docker ps -a -q)
}
# This is Git's per-user configuration file.
[user]
name = Wyatt Kirby
email = wyatt@apsis.io
[github]
user = wkirby
[core]
editor = code --wait
[color]
status = always
[alias]
status = status -s
cp = cherry-pick
st = status -s
cl = clone
ci = commit
co = checkout
cob = checkout -b
amend = commit -a --amend
cm = !git add -A && git commit -m
undo = reset HEAD~1 --mixed
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
put = "!f() { git rev-parse --abbrev-ref HEAD | xargs git push -v -u ${1-origin}; }; f"
cleanup = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f"
done = "!f() { git checkout ${1-master} && git up && git cleanup ${1-master}; }; f"
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[mergetool "p4mergetool"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge $PWD/$BASE $PWD/$REMOTE $PWD/$LOCAL $PWD/$MERGED
trustExitCode = false
[mergetool "unity"]
trustExitCode = false
cmd = '/Applications/Unity/Unity.app/Contents/Tools/UnityYAMLMerge' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
[mergetool]
keepBackup = false
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
tap 'caskroom/cask'
brew 'git'
brew 'git-lfs'
brew 'npm'
brew 'nvm'
brew 'rbenv'
brew 'docker'
brew 'docker-compose'
brew 'duti'
brew 'python'
brew 'python3'
brew 'watchman'
brew 'awscli'
brew 'aws-elasticbeanstalk'
brew 'ffmpeg'
brew 'imagemagick'
brew 'ripgrep'
brew 'jenv'
cask 'docker'
cask 'sublime-text'
cask 'google-chrome'
cask 'spectacle'
cask '1password'
cask 'slack'
cask 'viscosity'
cask 'iterm2'
cask 'visual-studio-code'
cask 'sublime-text'
cask 'blender'
cask 'vagrant'
cask 'sketch'
cask 'dropbox'
cask 'box-sync'
cask 'keybase'
cask 'rowanj-gitx'
cask 'unity'
cask 'virtualbox'
cask 'appcleaner'
cask 'cleanmymac'
cask 'alfred'
mas 'Pixelmator', id: 407963104
mas 'Numbers', id: 409203825
mas 'Pages', id: 409201541
mas 'Xcode', id: 497799835
if ! [ -x "$(command -v duti)" ]; then
brew install duti
fi
echo "Setting defaults for developer files...\n"
EDITOR_APP_ID=com.microsoft.VSCode
filetypes=(
".cs"
".erb"
".html"
".js"
".json"
".jsx"
".md"
".php"
".py"
".rb"
".sh"
".ts"
".tsx"
)
for i in "${filetypes[@]}"
do
echo "\tSetting default app for $i..."
duti -s $EDITOR_APP_ID $i all
done
echo "Setting defaults for network files...\n"
duti -s org.mozilla.firefox ftp
duti -s org.mozilla.firefox afp
duti -s org.mozilla.firefox smb
# Hide all desktop items
defaults write com.apple.finder CreateDesktop false
killall Finder
# Set keyboard repeat rate
defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1
# Stop hiding useful files
chflags nohidden ~/Library
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true
# Setup git
echo "Enter git name"
read gitname
echo "Enter git email"
read gitemail
git config --global user.name "${gitname}"
git config --global user.email "${gitemail}"
git config --global color.ui auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment