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 | |
# This script will pick commits from current branch(default) to other | |
# specified branch. | |
# Usage: | |
# git-pick.sh -<num> -- pick <num> commits start from HEAD | |
# git-pick.sh <commit range, etc> -- pick the correspondidng commits | |
# git-pick.sh -- default: pick commits | |
# |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# We will need 3 threads | |
import os | |
import Queue | |
from os.path import isfile, join | |
import email | |
import re |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import subprocess as sp | |
import time | |
import re | |
import sys | |
import signal | |
# global configuration |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
from urlparse import parse_qs | |
PORT_NUMBER = 8000 | |
class MyHandler(BaseHTTPRequestHandler): |
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
// ==UserScript== | |
// @name Post test | |
// @namespace jinzhou | |
// @description Post Test | |
// @include * | |
// @version 1 | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @grant GM_xmlhttpRequest | |
// @grant GM_addStyle | |
// ==/UserScript== |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
from PIL import Image | |
import io | |
import pickle | |
import os | |
import json | |
import time |
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
dir="." #Set the default temp dir | |
tmpA1="$dir/spectrumhist_1_$$.png" | |
tmpB1="$dir/spectrumhist_1_$$.cache" | |
trap "rm -f $tmpA1 $tmpB1; exit 0" 0 #remove temp files | |
trap "rm -f $tmpA1 $tmpB1; exit 1" 1 2 3 15 #remove temp files | |
if [ $# -eq 2 ] | |
then | |
colors=$2 | |
else | |
colors=8 |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys, argparse | |
from PIL import Image | |
from PIL.ImageDraw import Draw | |
import sys | |
def to_hash(color): |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
from bs4 import BeautifulSoup | |
import re | |
import os | |
import json | |
import logging | |
import traceback |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# translate utility that utilize google translator, support python2 & python3 | |
# Note that the order or arguments in the URL matters. | |
try: | |
from urllib import urlencode | |
except: | |
from urllib.parse import urlencode |