Skip to content

Instantly share code, notes, and snippets.

View BenoitMC's full-sized avatar
👋
hey !

BenoitMC BenoitMC

👋
hey !
View GitHub Profile
@BenoitMC
BenoitMC / web-servers.md
Created October 7, 2016 13:01 — forked from willurd/web-servers.md
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
@BenoitMC
BenoitMC / gist:5437814
Created April 22, 2013 19:32
rack middleware template
class MyMiddleware
def initialize(app)
@app = app
end
def call(env)
status, headers, body = @app.call(env)
# ...
return [status, headers, body]
end
@BenoitMC
BenoitMC / index.html
Created April 3, 2013 13:55
opensearch template
<!DOCTYPE html>
<html lang="...">
<head>
<meta charset="utf-8" />
<title>...</title>
<link rel="search" type="application/opensearchdescription+xml" title="..." href="/opensearch.xml" />
</head>
<body>
<p>...</p>
</body>