aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.functions8
1 files changed, 8 insertions, 0 deletions
diff --git a/.functions b/.functions
index b9ec9dd..1754c93 100644
--- a/.functions
+++ b/.functions
@@ -25,6 +25,14 @@ function server() {
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
}
+# Get gzipped file size
+function gz() {
+ echo "orig size (bytes): "
+ cat "$1" | wc -c
+ echo "gzipped size (bytes): "
+ gzip -c "$1" | wc -c
+}
+
# 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() {