Skip to content

Instantly share code, notes, and snippets.

View xiaocong's full-sized avatar
🐶
I may be slow to respond.

xiaocong xiaocong

🐶
I may be slow to respond.
View GitHub Profile
@xiaocong
xiaocong / gist:7767195
Created December 3, 2013 10:36 — forked from Mithrandir0x/gist:3639232
angular provider/service/factory
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@xiaocong
xiaocong / gist:6988640
Created October 15, 2013 08:50 — forked from anjackson/gist:2888380
python proxy
import bottle
from wsgiproxy.app import WSGIProxyApp
# Remove "hop-by-hop" headers (as defined by RFC2613, Section 13)
# since they are not allowed by the WSGI standard.
FILTER_HEADERS = [
'Connection',
'Keep-Alive',
'Proxy-Authenticate',
'Proxy-Authorization',