just run this command on your mac:
brew install https://gist.github.com/raw/1007028/66c1911132a2970b9df9723bd8063ac13e926993/nginx.rb
import tornado.web | |
class route(object): | |
""" | |
decorates RequestHandlers and builds up a list of routables handlers | |
Tech Notes (or "What the *@# is really happening here?") | |
-------------------------------------------------------- | |
Everytime @route('...') is called, we instantiate a new route object which |
import logging | |
import os | |
# Add appengine stuff to path | |
import dev_appserver as script | |
script.fix_sys_path() | |
from google.appengine.api import yaml_errors | |
from google.appengine.tools import dev_appserver | |
from google.appengine.tools import dev_appserver_main as main |
#!/usr/bin/env python | |
from twisted.internet import reactor | |
from twisted.web import proxy, server | |
from twisted.web.resource import Resource | |
class ProxyResource(Resource): | |
def getChild(self, path, request): | |
request.received_headers['x-forwarded-host'] = request.received_headers['host'] |
# -*- coding: utf-8 -*- | |
# Copyright (C) <2010> Gabriel Falcão <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
#!/usr/bin/env python | |
import sys, paramiko | |
if len(sys.argv) < 5: | |
print "args missing" | |
sys.exit(1) | |
hostname = sys.argv[1] | |
password = sys.argv[2] |
just run this command on your mac:
brew install https://gist.github.com/raw/1007028/66c1911132a2970b9df9723bd8063ac13e926993/nginx.rb
'''Hooks for lettuce to run a test pylons app''' | |
from lettuce import * | |
from paste.fixture import TestApp | |
import pylons.test | |
from paste.deploy.loadwsgi import loadapp | |
from paste.script.appinstall import SetupCommand |
# Usage: | |
# source iterm2.zsh | |
# iTerm2 tab color commands | |
# https://iterm2.com/documentation-escape-codes.html | |
if [[ -n "$ITERM_SESSION_ID" ]]; then | |
tab-color() { | |
echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
echo -ne "\033]6;1;bg;green;brightness;$2\a" |
#GNU Screen Cheat Sheet
##Basics
#!/usr/bin/env python | |
import sys, os, time, platform | |
sample_ansi = '\x1b[31mRED' + '\x1b[33mYELLOW' + '\x1b[32mGREEN' + '\x1b[35mPINK' + '\x1b[0m' + '\n' | |
for handle in [sys.stdout, sys.stderr]: | |
if (hasattr(handle, "isatty") and handle.isatty()) or \ | |
('TERM' in os.environ and os.environ['TERM']=='ANSI'): | |
if platform.system()=='Windows' and not ('TERM' in os.environ and os.environ['TERM']=='ANSI'): |