Skip to content

Instantly share code, notes, and snippets.

@kimmobrunfeldt
Last active July 26, 2022 13:30
Show Gist options
  • Save kimmobrunfeldt/350f4898d1b82cf10bce to your computer and use it in GitHub Desktop.
Save kimmobrunfeldt/350f4898d1b82cf10bce to your computer and use it in GitHub Desktop.
Install web development tools to Mavericks (OS X 10.9)

Install web development tools to Mavericks (OS X 10.9)

Strongly opinionated set of guides to quickly setup OS X Mavericks for web development. By default OS X hides stuff that normal people don't need to see. These settings are better defaults for developers.

I don't want: any sounds, annoying confirmation dialogs, hidden extensions, superflous animations, unnecessary things running like Dashboard, Notification center or Dock(Alfred/spotlight works better for me).

These are my opinions. Read this document through and pick up the good parts to your preferences.

System preferences

Save the following commands as system-preferences.sh and run bash system-preferences.sh

###############################################################################
# General                                                                     #
###############################################################################

echo "Add some Finnish localization"
defaults write NSGlobalDomain AppleLocale -string "fi_FI"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters"
defaults write NSGlobalDomain AppleMetricUnits -bool true

echo "Disable the 'Are you sure you want to open this application?' dialog"
defaults write com.apple.LaunchServices LSQuarantine -bool false

echo "Disable Notification Center and remove the menu bar icon"
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist

echo "Disable auto-correct"
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

echo "Show percentage in battery status"
defaults write com.apple.menuextra.battery ShowPercent -string "YES"
defaults write com.apple.menuextra.battery ShowTime -string "NO"

echo "Fix fonth smoothing"
defaults -currentHost write -globalDomain AppleFontSmoothing -int 0

echo "Enable repeat on keydown"
defaults write -g ApplePressAndHoldEnabled -bool false

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

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

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

echo "Set a blazingly fast keyboard repeat rate"
defaults write NSGlobalDomain KeyRepeat -int 0.02

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

echo "Show the ~/Library folder"
chflags nohidden ~/Library

echo "Disable rubberband scrolling"
defaults write -g NSScrollViewRubberbanding -bool false

echo "Disable dashboard"
defaults write com.apple.dashboard mcx-disabled -boolean YES

echo "Move dock to left side of screen"
defaults write com.apple.dock orientation -string left

echo "Hide dock automatically"
defaults write com.apple.dock autohide -boolean true

# I actually didn't get this working.. ideas?
echo "Set Dock auto-hide delay"
defaults write com.apple.dock autohide-delay 0

echo "Show all filename extensions in Finder"
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

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

echo "Expand print panel by default"
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true

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

echo "Disable the warning when changing a file extension"
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

echo "Require password after a minute after sleep or screen saver begins"
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 60

echo "Use list view in all Finder windows by default"
echo "Four-letter codes for the other view modes: icnv, Nlmv, Flwv"
defaults write com.apple.finder FXPreferredViewStyle -string "Nlmv"

echo "Remove default text from basic screen saver"
defaults write ~/Library/Preferences/com.apple.ScreenSaver.Basic MESSAGE " "

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

echo "Disable user interface sound effects"
defaults write com.apple.systemsound 'com.apple.sound.uiaudio.enabled' -int 0

echo "Set system sounds volume to 0"
defaults write com.apple.systemsound com.apple.sound.beep.volume -float 0

###############################################################################
# Trackpad, Mouse, Keyboard, Gestures                                         #
###############################################################################

echo "Enable tap to click (Trackpad)"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1

echo "Use scroll gesture with the Ctrl (^) modifier key to zoom"
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144

echo "Follow mouse when zoomed in"
defaults write com.apple.universalaccess closeViewPanningMode -int 0

echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3

echo "Tap with two fingers to emulate right click"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true

echo "Disable three finger drag"
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadThreeFingerDrag -bool false

echo "Disable automatic rearrangement of spaces based on most recent usage"
defaults write com.apple.dock mru-spaces -bool false

# For reference
# echo "Save screenshots to the desktop"
# defaults write com.apple.screencapture location -string "$HOME/Desktop"

###############################################################################
# Activity monitor                                                            #
###############################################################################

echo "Sort Activity Monitor results by CPU usage"
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0


echo "Kill affected applications, so the changes apply"
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done

After that, you have to do some settings manually. At least on clean Mavericks, these settings did not have effect when using defaults write

  • Keyboard > Shortcuts > Keyboard: Move focus to next window shortcut to ⌘+§

  • Accessibility > Mouse & Trackpad > Trackpad: enable dragging with drag lock

  • Trackpad

Install apps

Drag and drop installs

  • Chrome

    I recommend using profiles in Chrome

  • Firefox

  • Opera

  • Atom

    Atom is a new text editor by GitHub. It has a huge community, which I think will lead to death of Sublime Text. Update: Except it is currently painfully slow compared to Sublime Text :(

  • Alfred

    Good replacement for spotlight

  • XCode command line tools

    Important: Homebrew and many other tools need this installed

  • Flowdock

    Very good group chat for teams, which has integrations to GitHub, Trello etc.

  • iTerm2

    Much better than default Terminal.app

  • BetterTouchTool

    Productivity app for creating gesture/mouse/keyboard shortcuts to about any action you can imagine. For example I have binded 3 finger tap to middle click, 3 finger left/right swipes to changing browser/text editor tabs and more.

    I tested moom as an alternative, but BetterTouchTool has more features and is free. BetterTouchTool also ships with a killer feature that I've missed most from Ubuntu(Gnome), check it out: https://www.youtube.com/watch?v=wUeKjkpBdCo

Not that trivial installs

  • Oh-my-zsh

    Replaces bash.

  • Homebrew

    Brew is essential for installing libraries and developer stuff easily.

    Install some basic tools:

      brew install git wget
    
  • z for autojump

    Instead of cd ~/code/personal/projects/secret/mysecretproject you can just z mysecretproject. Fast.

    Install:

      mkdir ~/.bin
      cd ~/.bin
      git clone https://github.com/rupa/z.git
      echo "source ~/.bin/z/z.sh" >> ~/.zshrc
    
  • scm_breeze

    Useful helper commands/aliases for git and others

  • Vagrant

    When you have difficult binaries to install like OpenCV or other complicated, it might be easier to install them to a vagrant box. Sometimes you just want to sudo apt-get install python-opencv python-numpy.

    If you don't want to pollute your OS X with tons of libraries and binaries(e.g. ruby gems/python packages), you can always spin up a vagrant box. For example you could have one vagrant box for running Python software and another for Ruby.

  • Docker

    "Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications."

    "Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud."

  • Real Python with Virtualenv

    OS X ships with its own Python but I recommend installing Python with brew. It makes setupping pip and other Python tools easier.

    Make sure that your brew installed Python is the one that you are running. If which python outputs /usr/bin/python. Then you need to add /usr/local/bin to your PATH before /usr/bin.

    After installing virtualenv with pip, install also mkvirtualenv for your convenience.

  • Ruby version manager

  • NodeJS + NPM

    Install with: pkg, brew or nvm. I prefer brew.

  • Postgres

    Mavericks does not have Postgres installed by default anymore: http://stackoverflow.com/questions/19611505/does-postgresql-exist-on-os-x-mavericks

    I think using http://postgresapp.com is the preferred way. Using brew might be fine also, don't know.

  • Windows virtual machines with IE versions

    Microsoft provides virtual machines for different Windows + IE version combinations for your testing convenience.

Further reading

I stole many of the information from these sources:

@ryanmaclean
Copy link

You might like Homebrew Caskroom! https://github.com/caskroom/homebrew-cask
Think homebrew, but for apps that are distributed via DMG. It solves the vagrant and docker post-install actions, for example.
I'm redoing my Yosemite install and figured that I'd give you a heads-up :)

@kimmobrunfeldt
Copy link
Author

Looks very nice! Thanks :)

@AlJohri
Copy link

AlJohri commented Nov 2, 2014

for a selection of common apps installable via homebrew-cask check out my setup script https://github.com/AlJohri/dotfiles/blob/master/setup-homebrew.sh#L140

@macmladen
Copy link

I've stumbled upon this in same search and it seem quality add on to your own steps:
http://fredkelly.net/articles/2014/10/19/developing_on_yosemite.html

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