aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
Diffstat (limited to '.functions')
-rw-r--r--.functions16
1 files changed, 8 insertions, 8 deletions
diff --git a/.functions b/.functions
index 871275d..b5270b3 100644
--- a/.functions
+++ b/.functions
@@ -1,32 +1,32 @@
# Create a new directory and enter it
function md() {
- mkdir -p "$@" && cd "$@"
+ mkdir -p "$@" && cd "$@"
}
# Test if HTTP compression (RFC 2616 + SDCH) is enabled for a given URL.
# Send a fake UA string for sites that sniff it instead of using the Accept-Encoding header. (Looking at you, ajax.googleapis.com!)
function httpcompression() {
- encoding="$(curl -LIs -H 'User-Agent: Mozilla/5 Gecko' -H 'Accept-Encoding: gzip,deflate,compress,sdch' "$1" | grep '^Content-Encoding:')" && echo "$1 is encoded using ${encoding#* }" || echo "$1 is not using any encoding"
+ encoding="$(curl -LIs -H 'User-Agent: Mozilla/5 Gecko' -H 'Accept-Encoding: gzip,deflate,compress,sdch' "$1" | grep '^Content-Encoding:')" && echo "$1 is encoded using ${encoding#* }" || echo "$1 is not using any encoding"
}
# Syntax-highlight JSON files
function json() {
- python -mjson.tool <<< "$*" | pygmentize -l javascript
+ python -mjson.tool <<< "$*" | pygmentize -l javascript
}
# All the dig info
function digga() {
- dig +nocmd "$1" any +multiline +noall +answer
+ dig +nocmd "$1" any +multiline +noall +answer
}
# Escape UTF-8 characters into their 3-byte format
function escape() {
- printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u)
- echo # newline
+ printf "\\\x%s" $(printf "$@" | xxd -p -c1 -u)
+ echo # newline
}
# Decode \x{ABCD}-style Unicode escape sequences
function unidecode() {
- perl -e "binmode(STDOUT, ':utf8'); print \"$@\""
- echo # newline
+ perl -e "binmode(STDOUT, ':utf8'); print \"$@\""
+ echo # newline
} \ No newline at end of file