diff --git a/.aliases b/.aliases index 7392a0dc851..54841551db0 100644 --- a/.aliases +++ b/.aliases @@ -14,8 +14,6 @@ alias dl="cd ~/Downloads" alias dt="cd ~/Desktop" alias p="cd ~/projects" alias g="git" -alias h="history" -alias j="jobs" # Detect which `ls` flavor is in use if ls --color > /dev/null 2>&1; then # GNU `ls` @@ -50,9 +48,6 @@ alias sudo='sudo ' # Get week number alias week='date +%V' -# Stopwatch -alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date' - # Get macOS Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update; sudo gem cleanup' @@ -74,10 +69,6 @@ alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder" # Clean up LaunchServices to remove duplicates in the “Open With” menu alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder" -# View HTTP traffic -alias sniff="sudo ngrep -d 'en1' -t '^(GET|POST) ' 'tcp and port 80'" -alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E \"Host\: .*|GET \/.*\"" - # Canonical hex dump; some systems have this symlinked command -v hd > /dev/null || alias hd="hexdump -C" @@ -129,10 +120,6 @@ alias plistbuddy="/usr/libexec/PlistBuddy" # Airport CLI alias alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport' -# Ring the terminal bell, and put a badge on Terminal.app’s Dock icon -# (useful when executing time-consuming commands) -alias badge="tput bel" - # Intuitive map function # For example, to list all directories that contain a certain file: # find . -name .gitattributes | map dirname @@ -140,7 +127,7 @@ alias map="xargs -n1" # 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 # Make Grunt print stack traces by default @@ -158,7 +145,7 @@ alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v exten alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend" # Reload the shell (i.e. invoke as a login shell) -alias reload="exec $SHELL -l" +alias reload="exec ${SHELL} -l" # Print each PATH entry on a separate line alias path='echo -e ${PATH//:/\\n}' diff --git a/.functions b/.functions index 577d1639181..bfbd71f37ef 100644 --- a/.functions +++ b/.functions @@ -75,15 +75,6 @@ function dataurl() { echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')"; } -# Create a git.io short URL -function gitio() { - if [ -z "${1}" -o -z "${2}" ]; then - echo "Usage: \`gitio slug url\`"; - return 1; - fi; - curl -i https://git.io/ -F "url=${2}" -F "code=${1}"; -} - # Start an HTTP server from a directory, optionally specifying the port function server() { local port="${1:-8000}"; @@ -135,24 +126,6 @@ function escape() { fi; } -# Decode \x{ABCD}-style Unicode escape sequences -function unidecode() { - perl -e "binmode(STDOUT, ':utf8'); print \"$@\""; - # print a newline unless we’re piping the output to another program - if [ -t 1 ]; then - echo ""; # newline - fi; -} - -# Get a character’s Unicode code point -function codepoint() { - perl -e "use utf8; print sprintf('U+%04X', ord(\"$@\"))"; - # print a newline unless we’re piping the output to another program - if [ -t 1 ]; then - echo ""; # newline - fi; -} - # Show all the names (CNs and SANs) listed in the SSL certificate # for a given domain function getcertnames() {