diff --git a/.aliases b/.aliases index 35446a14288..8321d47ba4a 100644 --- a/.aliases +++ b/.aliases @@ -57,7 +57,6 @@ alias canary='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Ch # IP addresses alias ip="dig +short myip.opendns.com @resolver1.opendns.com" -alias localip="ipconfig getifaddr en0" alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'" # Show active network interfaces diff --git a/.functions b/.functions index bce0305db69..91b2397ac20 100644 --- a/.functions +++ b/.functions @@ -169,3 +169,9 @@ function o() { function tre() { tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX; } + +# echo the IP address for the currently active network interface +function localip() { + local activeIf=$(netstat -rn | grep default | awk '{print $NF}' | head -1) + ipconfig getifaddr ${activeIf} +} diff --git a/.gitconfig b/.gitconfig index b44243359b9..283aed074a5 100644 --- a/.gitconfig +++ b/.gitconfig @@ -22,7 +22,7 @@ ca = !git add -A && git commit -av # Switch to a branch, creating it if necessary - go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f" + go = "!f() { git checkout \"$1\" 2> /dev/null || git checkout -b \"$1\"; }; f" # Show verbose output about tags, branches or remotes tags = tag -l @@ -59,6 +59,9 @@ # Remove branches that have already been merged with master # a.k.a. ‘delete merged’ dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" + + # Remove stale branches that are gone on remote + dg = "!git branch -vv | grep ': gone]'| grep -v '\\*' | awk '{ print $1; }' | xargs -I F git branch -D \"F\"" # List contributors with number of commits contributors = shortlog --summary --numbered @@ -79,6 +82,10 @@ fi \ }; f" + # Compare two branches and show which commits are not in the first + # but in the second branch + compare = "!f() { git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative $1..$2; }; f" + [apply] # Detect whitespace errors when applying a patch diff --git a/.macos b/.macos index 2ce16068182..c0a0404e34b 100755 --- a/.macos +++ b/.macos @@ -156,7 +156,7 @@ defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClic defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true # Disable “natural” (Lion-style) scrolling -defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false +# defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false # Increase sound quality for Bluetooth headphones/headsets defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40 @@ -181,8 +181,8 @@ defaults write NSGlobalDomain InitialKeyRepeat -int 10 # Set language and text formats # Note: if you’re in the US, replace `EUR` with `USD`, `Centimeters` with # `Inches`, `en_GB` with `en_US`, and `true` with `false`. -defaults write NSGlobalDomain AppleLanguages -array "en" "nl" -defaults write NSGlobalDomain AppleLocale -string "en_GB@currency=EUR" +defaults write NSGlobalDomain AppleLanguages -array "en" +defaults write NSGlobalDomain AppleLocale -string "en_US@currency=EUR" defaults write NSGlobalDomain AppleMeasurementUnits -string "Centimeters" defaults write NSGlobalDomain AppleMetricUnits -bool true