Permalink
Browse files

Merge remote-tracking branch 'mathiasbynens/master'

* mathiasbynens/master:
  .osx: Allow installing user scripts via Userscripts.org
  .osx: Allow installing user scripts via GitHub or gists
  .aliases: Make `update` update Ruby gems as well
  .aliases: Add `dl`
  .aliases: Alias `sha1sum` if needed
  .osx: Consistency tweaks
  .aliases: Add `dt`
  .osx: Restart Dashboard
  .osx: Correct symlink for iOS Simulator

Conflicts:
	.aliases
	.osx
  • Loading branch information...
2 parents 5bc0433 + 866d6fe commit 9bb6984cbdfafc08ddb68dcd1c13d58f4e1ee98d @jeffbyrnes committed Oct 5, 2012
Showing with 31 additions and 19 deletions.
  1. +12 −8 .aliases
  2. +19 −11 .osx
View
@@ -8,7 +8,9 @@ alias -- -="cd -"
# Shortcuts
alias d="cd ~/Dropbox"
-alias p="cd ~/Sites"
+alias dl="cd ~/Downloads"
+alias dt="cd ~/Desktop"
+alias p="cd ~/Projects"
alias g="git"
alias gco='git co'
alias gci='git ci'
@@ -56,9 +58,9 @@ alias cdhhlive="cd ${serverpath}healthheadlines.com/httpdocs"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
- colorflag="--color"
+ colorflag="--color"
else # OS X `ls`
- colorflag="-G"
+ colorflag="-G"
fi
# List all files colorized in long format
@@ -71,7 +73,6 @@ alias la="ls -lapFh ${colorflag}"
alias lsd='ls -l ${colorflag} | grep "^d"'
# Always use color output for `ls`
-# [ "$TERM" = "xterm" ] && TERM="xterm-256color"
alias ls="command ls ${colorflag}"
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
@@ -81,8 +82,8 @@ alias sudo='sudo '
# Gzip-enabled `curl`
alias gurl="curl --compressed"
-# Get OS X Software Updates, and update Homebrew, npm, and their installed packages
-alias update='sudo softwareupdate -i -a; brew update; brew upgrade; npm update npm -g; npm update -g'
+# Get OS X Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
+alias update='sudo softwareupdate -i -a; brew update; brew upgrade; npm update npm -g; npm update -g; sudo gem update'
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
@@ -108,6 +109,9 @@ command -v hd > /dev/null || alias hd="hexdump -C"
# OS X has no `md5sum`, so use `md5` as a fallback
command -v md5sum > /dev/null || alias md5sum="md5"
+# OS X has no `sha1sum`, so use `shasum` as a fallback
+command -v sha1sum > /dev/null || alias sha1sum="shasum"
+
# Trim new lines and copy to clipboard
alias c="tr -d '\n' | pbcopy"
@@ -150,10 +154,10 @@ alias badge="tput bel"
# One of @janmoesen’s ProTip™s
for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
- alias "$method"="lwp-request -m '$method'"
+ alias "$method"="lwp-request -m '$method'"
done
# Stuff I never really use but cannot delete either because of http://xkcd.com/530/
alias stfu="osascript -e 'set volume output muted true'"
alias pumpitup="osascript -e 'set volume 7'"
-alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
+alias hax="growlnotify -a 'Activity Monitor' 'System error' -m 'WTF R U DOIN'"
View
30 .osx
@@ -197,7 +197,7 @@ defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
# Finder: show hidden files by default
-# defaults write com.apple.Finder AppleShowAllFiles -bool true
+# defaults write com.apple.finder AppleShowAllFiles -bool true
# Finder: show all filename extensions
# defaults write NSGlobalDomain AppleShowAllExtensions -bool true
@@ -252,7 +252,7 @@ defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
-defaults write com.apple.Finder FXPreferredViewStyle -string "Nlsv"
+defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
# Disable the warning before emptying the Trash
# defaults write com.apple.finder WarnOnEmptyTrash -bool false
@@ -317,8 +317,8 @@ defaults write com.apple.dock showhidden -bool true
# Reset Launchpad
find ~/Library/Application\ Support/Dock -name "*.db" -maxdepth 1 -delete
-# Add iPhone Simulator.app to Launchpad
-# ln -s /Applications/Xcode.app/Contents/Applications/iPhone\ Simulator.app ~/Applications
+# Add iOS Simulator to Launchpad
+# ln -s /Applications/Xcode.app/Contents/Applications/iPhone\ Simulator.app /Applications/iOS\ Simulator.app
# Add a spacer to the left side of the Dock (where the applications are)
#defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
@@ -405,8 +405,8 @@ defaults write com.apple.iTunes NSUserKeyEquivalents -dict-add "Target Search Fi
###############################################################################
# Disable send and reply animations in Mail.app
-# defaults write com.apple.Mail DisableReplyAnimations -bool true
-# defaults write com.apple.Mail DisableSendAnimations -bool true
+# defaults write com.apple.mail DisableReplyAnimations -bool true
+# defaults write com.apple.mail DisableSendAnimations -bool true
# Copy email addresses as `foo@example.com` instead of `Foo Bar <foo@example.com>` in Mail.app
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
@@ -424,8 +424,8 @@ defaults write com.apple.terminal StringEncodings -array 4
# Use a modified version of the Pro theme by default in Terminal.app
# open "$HOME/init/Mathias.terminal"
# sleep 1 # Wait a bit to make sure the theme is loaded
-# defaults write com.apple.Terminal "Default Window Settings" -string "Mathias"
-# defaults write com.apple.Terminal "Startup Window Settings" -string "Mathias"
+# defaults write com.apple.terminal "Default Window Settings" -string "Mathias"
+# defaults write com.apple.terminal "Startup Window Settings" -string "Mathias"
# Enable “focus follows mouse” for Terminal.app and all X11 apps
# i.e. hover over a window and start typing in it without clicking first
@@ -466,6 +466,14 @@ defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
###############################################################################
+# Google Chrome & Google Chrome Canary #
+###############################################################################
+
+# Allow installing user scripts via GitHub or Userscripts.org
+defaults write com.google.Chrome ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
+defaults write com.google.Chrome.canary ExtensionInstallSources -array "https://*.github.com/*" "http://userscripts.org/*"
+
+###############################################################################
# SizeUp.app #
###############################################################################
@@ -523,9 +531,9 @@ defaults write com.twitter.twitter-mac HideInBackground -bool true
# Kill affected applications #
###############################################################################
-for app in "Address Book" "Calendar" "Contacts" "Dock" "Finder" "Mail" \
- "Safari" "SizeUp" "SystemUIServer" "Terminal" "Transmission" "Twitter" \
- "iCal" "iTunes"; do
+for app in "Address Book" "Calendar" "Contacts" "Dashboard" "Dock" "Finder" \
+ "Mail" "Safari" "SizeUp" "SystemUIServer" "Terminal" "Transmission" \
+ "Twitter" "iCal" "iTunes"; do
killall "$app" > /dev/null 2>&1
done
echo "Done. Note that some of these changes require a logout/restart to take effect."

0 comments on commit 9bb6984

Please sign in to comment.