Skip to content

Instantly share code, notes, and snippets.

@shihshen
shihshen / reflect.py
Last active June 8, 2017 18:30 — forked from huyng/reflect.py
A simple echo server to inspect http web requests for python3
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from http.server import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@shihshen
shihshen / DeployToOpenshift
Last active August 29, 2015 14:03
Howto deploy sails app to openshift
1. A config/local.js looked like https://github.com/Powpow-Shen/prototype-a/blob/master/config/local.js
2. A .gitignore file looked like https://github.com/Powpow-Shen/prototype-a/blob/master/.gitignore, but comment local.js and don't commit confidential data in.
3. workaround for https://github.com/dbashford/mimosa-bower/issues/29#issuecomment-36615528
change postinstall in package.json to "postinstall": "HOME=$HOME/app-root/runtime bower install"
4. That's all
@shihshen
shihshen / .jshintrc
Created December 25, 2013 15:01 — forked from haschek/.jshintrc
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true