Skip to content

Instantly share code, notes, and snippets.

@kuatsure
Created February 18, 2014 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuatsure/9075871 to your computer and use it in GitHub Desktop.
Save kuatsure/9075871 to your computer and use it in GitHub Desktop.
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();' "8000"
if [ ! -d site ]; then
# download .zip file
wget https://github.com/daytoncleancoders/projects/raw/master/commandline/command-line-kata.zip
# extraction ( all .zips, not just the above in pwd )
tar -xf *.zip
# cd into project directory
cd site
# begin move
mkdir img
find . -name \*.jpg -print -exec mv {} img/ \;
find . -name \*.png -print -exec mv {} img/ \;
mkdir css
find . -name \*.css -print -exec mv {} css/ \;
mkdir js
find . -name \*.js -print -exec mv {} js/ \;
mkdir fonts
find . -name \*.woff -print -exec mv {} fonts/ \;
fi
# start httpserver
if [ -d site ]; then
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();' "8000"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment