Skip to content

Instantly share code, notes, and snippets.

View orangle's full-sized avatar
🎯
Focusing

orangleliu orangle

🎯
Focusing
View GitHub Profile
@orangle
orangle / example.py
Created April 24, 2016 07:20 — forked from beenje/example.py
Twisted gateway
import json
import time
from twisted.internet import defer
from twisted.internet.protocol import ServerFactory
from twisted.protocols.basic import LineReceiver
from twisted.python import log
class BasicProtocol(LineReceiver):
@orangle
orangle / gist:ecec23e8e7afb8ee1aa5
Created February 25, 2016 05:28 — forked from lucifr/gist:1208100
Sublime Text 2 - 实用快捷键 (Mac OS X)
@orangle
orangle / nginx.conf
Created January 21, 2016 07:44 — forked from phpdude/nginx.conf
Nginx image filter + caching of results.
location /resize {
alias /tmp/nginx/resize;
set $width 150;
set $height 100;
set $dimens "";
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) {
set $width $1;
set $height $2;
set $image_path $3;
import socket
import sys
import time
import struct
host = 'localhost'
port = 8888
buffersize = 1024
N = 1000000
server_address = (host, port)
@orangle
orangle / punch.py
Last active August 29, 2015 14:26 — forked from koenbollen/punch.py
Proof of Concept: UDP Hole Punching
#!/usr/bin/env python
#
# Proof of Concept: UDP Hole Punching
# Two client connect to a server and get redirected to each other.
#
# This is the client.
#
# Koen Bollen <meneer koenbollen nl>
# 2010 GPL
#
@orangle
orangle / runinenv.sh
Last active August 29, 2015 14:19 — forked from parente/runinenv.sh
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"