Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace the `server` alias with a function that optionally takes an a…

…rgument specifying the port number

Inspired by @padolsey’s https://gist.github.com/1525217#gistcomment-71652.
  • Loading branch information...
commit 958517dcf4210aefffcafa3cc41f4ebb4edd5e36 1 parent 147eff2
@mathiasbynens authored
Showing with 9 additions and 0 deletions.
  1. +2 −0  .aliases
  2. +7 −0 .functions
View
2  .aliases
@@ -25,6 +25,8 @@ alias undopush="git push -f origin HEAD^:master"
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1"
alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
+
+# Enhanced WHOIS lookups
alias whois="whois -h whois-servers.net"
# Flush Directory Service cache
View
7 .functions
@@ -3,6 +3,13 @@ function md() {
mkdir -p "$@" && cd "$@"
}
+# Start an HTTP server from a directory, optionally specifying the port
@NV
NV added a note

Check out command-line tool for Pow!. ’Cause dirname.dev is nicer than localhost:$port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+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() {

0 comments on commit 958517d

Please sign in to comment.
Something went wrong with that request. Please try again.