(python)jay@localhost:~/Desktop$ python --version
Python 2.7.2
(python)jay@localhost:~/Desktop$ cat urllib2-leaks.py
import gc
import inspect
import logging| namespace java base | |
| namespace js base | |
| enum Status { | |
| SUCCESS = 1, | |
| FAIL = 2, | |
| } | |
| struct Children { | |
| 1: optional string name, |
| #!/bin/sh | |
| # Run some pre commit checks on the Go source code. Prevent the commit if any errors are found | |
| echo "Running pre-commit checks on your code..." | |
| FILES=$(go list ./... | grep -v /vendor/|grep -v /thrift_gen) | |
| # Format the Go code | |
| go fmt ${FILES} |
| alias dl="cd ~/Downloads/" | |
| alias gos="cd ~/go/src/" | |
| alias unproxy="unset http_proxy; unset https_proxy" | |
| # Command history search | |
| bindkey -v | |
| bindkey '^R' history-incremental-search-backward | |
| # Go proxy | |
| export GOPROXY=https://goproxy.cn |
| # vim style tmux config | |
| # use C-q, since it's on the home row and easier to hit than C-b | |
| set-option -g prefix C-q | |
| unbind-key C-q | |
| bind-key C-q send-prefix | |
| set -g base-index 1 | |
| # Easy config reload | |
| bind-key R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded." |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Copyright ©2017-01-16 Alex <[email protected]> | |
| # | |
| """ | |
| crawl the itjuzi.com company data | |
| """ | |
| import requests | |
| import time |
| #! /usr/bin/osascript | |
| (* | |
| --------------------------------------------------------------------------------- | |
| Script: SpreadsheetExportToCSV | |
| Command-line tool to convert a spreadsheet document to CSV | |
| This AppleScript is tested with and compatible with Apple iWork Numbers 3.6, | |
| current as at October 23, 2015. |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Copyright ©2016-12-08 Alex <[email protected]> | |
| # | |
| """ | |
| 当当分布式id生成器冲突概率计算,生成器设计见: | |
| http://dangdangdotcom.github.io/sharding-jdbc/post/id-generator/ | |
| """ | |
| import sys |
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # Copyright ©2015-05-21 Alex <[email protected]> | |
| # | |
| """ | |
| 对比: | |
| pipe : pipe line 方式一次读取hash内多个key | |
| loop : 遍历读取这些hash key | |
| mget : 原生命令一次性读取string key |
(python)jay@localhost:~/Desktop$ python --version
Python 2.7.2
(python)jay@localhost:~/Desktop$ cat urllib2-leaks.py
import gc
import inspect
import logging| function killall(ns, wet_run) { | |
| ns = (typeof (ns) != 'undefined') ? ns : ""; | |
| inprog = db.currentOp().inprog; | |
| for (var i in inprog) { | |
| var op = inprog[i]; | |
| if (op.ns.indexOf(ns) != -1) { | |
| if (wet_run == true) { | |
| db.killOp(op.opid); | |
| } else { | |
| var toprint = {} |