Clean Install – OS X 10.10 Yosemite
Some text to describe it all here.
A simple list of regular applications and plugins.
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
Oh My Zsh is an open source, community-driven framework for managing your zsh configuration. To learn more visit ohmyzsh.sh.
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
First download doubleend theme.
Put the downloaded theme file in ~/.oh-my-zsh/themes/doubleend.zsh-theme
. To activate doubleend
theme update ~/.zshrc
with:
ZSH_THEME="doubleend"
For some additional niceness download inconsolata font and solarized theme.
For some autocomplete niceness update ~/.zshrc
with:
plugins=(git osx github node npm ruby gem brew composer bower)
These are not required, but provides a nice abstraction for PHP development server. The server defaults to port 8000
, but can easily be overridden.
Run projects with serve <port>
.
serve() {
PORT=8000
if [ ! -z $1 ]; then
PORT=$1
fi
php artisan serve --host=0.0.0.0 --port="$PORT" --env=local;
}
Run projects with server <folder> <port>
or server <port>
. If the first argument is a string it will be used as <folder>
otherwise it will be used as <port>
.
server() {
DOCUMENT_ROOT=""
PORT=8000
if [ ! -z $1 ]; then
if [ $1 -eq $1 ] 2>/dev/null; then
PORT=$1
else
DOCUMENT_ROOT=$1
fi
fi
if [ ! -z $2 ]; then
DOCUMENT_ROOT=$2
fi
if [ ! -z $DOCUMENT_ROOT ]; then
php -S 0.0.0.0:"$PORT" -t $DOCUMENT_ROOT
else
php -S 0.0.0.0:"$PORT"
fi
}
Remembering shell-config
is easier than remembering subl ~/.zshrc
.
alias shell-config="subl ~/.zshrc"
Command Line Tools for Xcode is required to get homebrew working. Minimum effort to install them is to run xcode-select --install
. However, it is nice to install Xcode for iOS device testing as well.
Homebrew — The missing package manager for OS X.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git ack wget curl gdbm
A custom hostname is funnier than "Your Name's Macbook".
sudo scutil --set HostName "<hostname>"
Some of my own UI preferences for and some general enhancements for OS X. Pick the ones you like.
# Fix fonth smoothing
defaults -currentHost write -globalDomain AppleFontSmoothing -int 0
# Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Show Path bar in Finder
defaults write com.apple.finder ShowPathbar -bool true
# Show Status bar in Finder
defaults write com.apple.finder ShowStatusBar -bool true
# Switch Finder to use list mode
defaults write com.apple.Finder FXPreferredViewStyle Nlsv
# Show all filename extensions in Finder
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# When performing a search, search the current folder by default
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Enable Safari’s debug menu
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Set sidebar icon size to small
defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 1
# Disable “natural” (Lion-style) scrolling
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
# Show the ~/Library folder
chflags nohidden ~/Library
# Enable AirDrop over Ethernet and on unsupported Macs running Lion
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
# Enable full keyboard access for all controls
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Hide icons for hard drives, servers, and removable media on the desktop
defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false
defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# Disable ext change warning
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
# Disable sound effect when changing volume
defaults write -g com.apple.sound.beep.feedback -integer 0
# Avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Set the icon size of Dock items to 26 pixels
defaults write com.apple.dock tilesize -int 26
# Trackpad: disable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool false
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 0
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 0
# Disable press-and-hold for keys in favor of key repeat
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Disable drop shadows from screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
More options in: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
By default alt + space
in OS X would result in a no breaking space. This results in all kinds of weird behaviours when writing code. The best solution is to override alt + space
and instead return a normal space.
~/Library/KeyBindings/DefaultKeyBinding.dict
{ "~ " = (insertText:, " "); }
into the newly created fileBasic setup for GIT.
ssh-keygen -t rsa -C "user.name@mail.com"
ssh-add id_rsa
# Copy ssh key to github.com
subl ~/.ssh/id_rsa.pub
# Test connection
ssh -T git@github.com
# Set git config values
git config --global user.name "Your Name"
git config --global user.email "user.name@gmail.com"
git config --global github.user username
git config --global github.token your_token_here
git config --global core.editor "subl -w"
git config --global color.ui true
git config --global push.default simple
# Set git default mergetool
git config --global merge.tool opendiff
More information about installing PHP can be found at josegonzalez/homebrew-php.
# Tap into brews
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
# Install basic PHP support
brew install php56 php56-mcrypt
# Update default config values in /usr/local/etc/php/5.6/php.ini
date.timezone = Europe/Stockholm
upload_max_filesize = 64M
post_max_size = 32M
brew install composer envoy
brew install mysql
# Secure MySQL
/usr/local/opt/mysql/bin/mysql_secure_installation
brew install node