Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

.functions: Add `gurl` function for gzip-enabled `curl`

  • Loading branch information...
commit e29deab2aad4b63c40c995253e5dc67c5d5f16f9 1 parent 1de8cb8
@mathiasbynens authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 .functions
View
5 .functions
@@ -18,6 +18,11 @@ 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"
}
+# Gzip-enabled `curl`
+function gurl() {
+ curl -sH "Accept-Encoding: gzip" "$@" | gunzip
+}
+
# Syntax-highlight JSON strings or files
function json() {
if [ -p /dev/stdin ]; then
Please sign in to comment.
Something went wrong with that request. Please try again.