diff options
author | Cãtãlin Mariş <alrraa@gmail.com> | 2013-05-10 09:21:21 +0200 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2013-05-10 09:23:04 +0200 |
commit | 485f2cbbfad73f29e8f567684e4a47ef30cf9eff (patch) | |
tree | bc47b49e3abb5e99ecf411136ac0c6d60a1b24ba /.functions | |
parent | b63c7613d0f2619a03f667ae7ff719306462ad23 (diff) | |
download | dotfiles-485f2cbbfad73f29e8f567684e4a47ef30cf9eff.tar.gz dotfiles-485f2cbbfad73f29e8f567684e4a47ef30cf9eff.tar.bz2 dotfiles-485f2cbbfad73f29e8f567684e4a47ef30cf9eff.zip |
.functions: Improve `httpcompression` and move it to its own file
Closes #162.
Diffstat (limited to '.functions')
-rw-r--r-- | .functions | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -112,12 +112,6 @@ function gz() { printf "gzip: %d bytes (%2.2f%%)\n" "$gzipsize" "$ratio" } -# 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() { - local 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 strings or files # Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json` function json() { |