This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from django.conf import settings | |
from django.contrib.auth import logout | |
from django.contrib.auth.models import User | |
from django.contrib.sessions.models import Session | |
from django.http import HttpRequest | |
from django.utils.importlib import import_module | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mek@bigbertha:~/7-Projects$ python | |
Python 2.7.2+ (default, Oct 4 2011, 20:06:09) | |
[GCC 4.6.1] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import time | |
>>> def test(): | |
... """Comapring concat. + vs list.extend""" | |
... x = range(10000000) | |
... y = range(10000000) | |
... x0 = time.clock() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getpassword() { | |
# Written for Mac OS X Keychain. | |
SERVICE=$1 | |
ACCOUNT=$2 | |
security find-internet-password -s $SERVICE -a $ACCOUNT -w | tr -d '\n' | |
} | |
function update_github_issues() { | |
read -p "Enter the repo owner: " OWNER | |
read -p "Enter the repo name: " REPO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# @link https://gist.github.com/mattscilipoti/8424018 | |
# | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: http://nicolasmerouze.com/guide-routers-golang/ | |
// Package httprouterwrapper allows the use of http.HandlerFunc compatible funcs with julienschmidt/httprouter | |
package httprouterwrapper | |
import ( | |
"net/http" | |
"github.com/gorilla/context" | |
"github.com/julienschmidt/httprouter" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python2 | |
# -*- coding: utf-8 -*- | |
# 一个简单的 Socks5 代理服务器 , 只有 server 端 , 而且代码比较乱 | |
# 不是很稳定 , 而且使用多线程并不是 select 模型 | |
# Author : WangYihang <[email protected]> | |
import socket | |
import threading | |
import sys |