Skip to content

Instantly share code, notes, and snippets.

@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
var jtv_api=function(){var e={},p=!(!document.all||window.opera),h=function(a,b){for(var d in a)a.hasOwnProperty(d)&&b(d,a[d])},k=function(a,b){for(var d=a.length,c=0;c<d;c++)b(a[c],c)},q=function(a,b){if(a.indexOf)return-1!=a.indexOf(b);for(var d=a.length,c=0;c<d;c++)if(a[c]==b)return!0;return!1},l=function(a,b){var d={};h(a,function(a,g){q(b,a)&&(d[a]=g)});return d},r=function(a){var b=[];h(a,function(a,c){b.push(a+"="+c)});return b.join("&")},n=function(a){var b={};k(a.split("&"),function(a){var a=
a.split("="),c=a[1];b[a[0]]=-1!=c.indexOf('"')?c.split('"')[1]:c});return b},m=function(a,b){var d={};h(a,function(b,a){d[b]=a});h(b,function(b,a){d[b]=a});return d},s=function(){for(var a=[],b=0;20>b;b++)a.push("abcdefghujklmnopqrstuvwxyz".charAt(26*Math.random()));a=a.join("");return document.getElementById(a)?s():a},j=function(a,b,d){a&&a[b]?a[b].apply(a,Array.prototype.slice.call(arguments).slice(2)):window.setTimeout(function(){j(a,b,d)},10)},t=function(a,b){"undefined"!=typeof a&&null!==a?b(a):
window.setT