aboutsummaryrefslogtreecommitdiffstats
path: root/.functions
diff options
context:
space:
mode:
Diffstat (limited to '.functions')
-rw-r--r--.functions7
1 files changed, 7 insertions, 0 deletions
diff --git a/.functions b/.functions
index a6a576d..4301825 100644
--- a/.functions
+++ b/.functions
@@ -3,6 +3,13 @@ function md() {
mkdir -p "$@" && cd "$@"
}
+# Start an HTTP server from a directory, optionally specifying the port
+function server() {
+ local port="$1"
+ [ -z "$port" ] && port=8000
+ open "http://localhost:${port}/" && python -m SimpleHTTPServer "$port"
+}
+
# 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() {