This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
| 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): |
This is a Chinese version of https://gist.github.com/1207002/86f48cd3b3b72c85e6293926cf7c730de03b2f08 from lucasfais
| ⌘T | 前往文件 |
| ⌘⌃P | 前往项目 |
| ⌘R | 前往 method |
| ⌘⇧P | 命令提示 |
| 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) |
| #!/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 | |
| # |
| #!/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 "$@" |