Display only active application in the Mac OS X Dock

If you prefer a minimalist Mac OS X Dock, set the Dock to only display active running apps.

defaults write com.apple.dock static-only -bool TRUE

Restart the Dock for changes to take effect:

killall Dock

Revert back to default, use this defaults write command:

defaults write com.apple.dock static-only -bool FALSE