Skip to content

Instantly share code, notes, and snippets.

@adamrunner
Forked from saetia/gist:1623487
Last active March 8, 2016 16:30
Show Gist options
  • Save adamrunner/f773fde62b9a26e576f2 to your computer and use it in GitHub Desktop.
Save adamrunner/f773fde62b9a26e576f2 to your computer and use it in GitHub Desktop.
Some steps to take when setting up a new mac

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

#Disable ext change warning
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

#Disable webkit homepage
defaults write org.webkit.nightly.WebKit StartPageDisabled -bool true

# Check for software updates daily, not just once per week
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1

#Use current directory as default search scope in Finder
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"

#Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true

#Disable sound effect when changing volume 
defaults write -g com.apple.sound.beep.feedback -integer 0

#Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true

#Enable AirDrop over Ethernet and on unsupported Macs
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true


# Show icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true && \
defaults write com.apple.finder ShowMountedServersOnDesktop -bool true && \
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true

# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

#Set a shorter Delay until key repeat
defaults write NSGlobalDomain InitialKeyRepeat -int 12

#Disable disk image verification
defaults write com.apple.frameworks.diskimages skip-verify -bool true && \
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true && \
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true

#Disable Safari’s thumbnail cache for History and Top Sites
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2

#Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true

# Disable smart quotes as it’s annoying for messages that contain code
defaults write com.apple.messageshelper.MessageController \
SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false


# Enable the Develop menu and the Web Inspector in Safari
defaults write com.apple.Safari IncludeDevelopMenu -bool true && \
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true && \
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true && \
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true

#Show the ~/Library folder
chflags nohidden ~/Library

#Show absolute path in finder's title bar. 
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES

#Enable text copying from Quick Look
com.apple.finder QLEnableTextSelection -bool YES

####Homebrew

#install package manager
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

#install homebrew packages
brew install \
tree \
node \
ssh-copy-id \
wget \
jpegoptim \
pngcrush \
redis \
colordiff \
imagemagick \
icoutils \
ack \
caskroom/cask/brew-cask

####Homebrew Cask Apps & Fonts

#NOTE: I usually just install these things by hand
#add support for fonts
brew tap caskroom/fonts

#add dev/beta versions
brew tap caskroom/versions

#install mac apps & fonts
brew cask install \
font-source-code-pro \
virtualbox \
google-chrome \
firefox \
sequel-pro \
vagrant \
spotify

###Git


####Setup Github

#NOTE: you can copy your ~/.ssh folder from your old laptop and avoid generating new keys
ssh-keygen -t rsa -C "adamrunner@gmail.com"

#copy ssh key to clipboard for adding to github.com, only if generating new keys
pbcopy < ~/.ssh/id_rsa.pub

#test connection
ssh -T git@github.com

#set git config values
git config --global user.name "Adam Runner" && 
git config --global user.email "adamrunner@gmail.com" &&
git config --global github.user adamrunner && 
git config --global core.editor "atom" &&
git config --global color.ui true &&
git config --global push.default simple

Fish Shell Configuration

You'll need to install Fish first. http://fishshell.com

brew install fish
#NOTE: put this file in ~/.config/fish/config.fish
set -gx RBENV_ROOT /usr/local/var/rbenv
. (rbenv init -|psub)

alias gs="git status"
alias gb="git branch"
alias gc="git checkout"
alias gd="git diff"
alias be="bundle exec"
alias speed="wget --output-document=/dev/null http://speedtest.wdc01.softlayer.com/downloads/test500.zip"
alias wanip="curl -qs http://ifconfig.co"

function ipinfo
   curl "ipinfo.io/$argv"
end

set PATH /Applications/Postgres.app/Contents/Versions/9.4/bin $PATH
set PATH ~/.composer/vendor/bin $PATH
set PATH /usr/local/opt/openssl/lib /usr/local/opt/openssl/include $PATH

rbenv

cd
git clone git://github.com/sstephenson/rbenv.git .rbenv

Vagrant


#NOTE: You only need to do this if you use vagrant. 
vagrant plugin install vagrant-hostsupdater

aww yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment