Emacs command summary, Thu Jul 25. link
KeyKey | Cmd |
---|
#place holder |
ccc () | |
{ | |
if [[ "$#" -lt 1 ]]; then | |
echo "Usage: $FUNCNAME <script.c> [optional_args]"; | |
return; | |
else | |
file=$1; | |
shift; | |
args=$*; | |
out=`mktemp`; |
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
"""xml2json.py Convert XML to JSON | |
Relies on ElementTree for the XML parsing. This is based on | |
pesterfish.py but uses a different XML->JSON mapping. | |
The XML->JSON mapping is described at | |
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html |
$.fn.vectorMap('addMap', 'cn_merc_en',{"insets": [{"width": 560, "top": 0, "height": 470, "bbox": [{"y": -7092705.234177706, "x": 8197509.958779432}, {"y": -2058430.530198134, "x": 15010424.448806616}], "left": 0}], | |
"paths": { | |
aomen:{ | |
name : "澳门特区", | |
path: "M413.032,414.183l-0.96,1.752c0,0,0.889,0.883,1.98,1.086s1.995-0.493,1.995-0.493L413.032,414.183z"}, | |
hongkong:{ | |
name : "香港特区", | |
path: "M417.745,409.005l3.394,0.773l3.453-2.558l1.666,4.582c0,0-5.521,2.673-3.691,1.785c1.828-0.884-4.641-0.355-4.641-0.355l-0.834-3.454L417.745,409.005z"}, | |
taiwan:{ | |
name : "台湾省", |
def init_db_env(): | |
import sys, os | |
os.environ["PYTHON_EGG_CACHE"] = "/tmp" | |
os.environ['PYTHONPATH']= '/home/rex/local/lib/python2.6/site-packages' | |
os.environ["LD_LIBRARY_PATH"] = '/home/rex/local/lib:/usr/lib/' | |
sys.path.append('/home/rex/local/lib/python2.6/site-packages') | |
sys.path.append('/home/rex/local/lib') | |
sys.path.append('/usr/lib/') | |
from ctypes import cdll | |
cdll.LoadLibrary("/usr/lib/libmysqlclient.so.18") |
for i in {1900..2012}; | |
do | |
wget -r ftp://ftp3.ncdc.noaa.gov/pub/data/noaa/$i/; | |
done |
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
# | |
# Author: Rex Zhang | |
# Create Time: 2012-11-13 10:14 | |
# File name: datadumper.py | |
import sys, os | |
import re | |
import imp |
Emacs command summary, Thu Jul 25. link
KeyKey | Cmd |
---|
#!/usr/bin/env bash | |
##代码打包: | |
p='cloudweb' | |
d=`date +"%Y-%m-%d"` | |
v=`git log -n 1 |pcregrep -io '(?<=commit )\w{8}'` | |
git archive master --prefix="$p/" | gzip > "$p"."$d"."$v".tar.gz |
#ctrl a | |
set -g prefix ^a | |
unbind ^b | |
bind a send-prefix | |
#此类配置可以在命令行模式中输入show-options -g查询 | |
#set-option -g base-index 1 #窗口的初始序号;默认为0,这里设置为1 | |
set-option -g display-time 5000 #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒 | |
set-option -g repeat-time 1000 #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒 | |
set-option -g status-keys emacs #操作状态栏时的默认键盘布局;可以设置为vi或emacs | |
set-option -g status-right "#(date +%H:%M' ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示 |