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
javascript: (function n(e){e.eq(0).fadeIn(99,function(){n(e.slice(1))})})($(":visible").hide()) |
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 time, functools | |
def timeit(func): | |
@functools.wraps(func) | |
def __do__(*args,**kwargs): | |
start = time.time() | |
result= func(*args,**kwargs) | |
print '%s used time %ss'%(func.__name__,time.time()-start) | |
return result | |
return __do__ |
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 log() | |
{ | |
local msg=$1 | |
now=`date "+%Y-%m-%d %H:%M:%S"` | |
i=${#FUNCNAME[@]} | |
lineno=${BASH_LINENO[$i-2]} | |
file=${BASH_SOURCE[$i-1]} | |
echo "${now} ${file}:${lineno} ${msg}" |
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
from sub import * | |
import sys | |
import os | |
import types | |
import traceback | |
import gc | |
import signal | |
import errno |
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
#get the comment of the last commit in svn | |
svn log -q -v --xml --with-all-revprops -r head | grep "^<msg" | sed -e "s/<msg>\(.*\)/\1/g" |
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
git archive --format=tar HEAD | (cd ~/beta/web && tar xf -) | |
git archive --format=tar HEAD | ssh app08.gz "(cd ~/beta/qn_fd_system && tar xf -)" |
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 | |
import os | |
begin = 1 | |
end = 3000000 | |
inc = 3000000 | |
for j in xrange(3): | |
with open('%s.txt' % (j + 1), 'w') as wf: | |
for i in xrange(begin, end + 1): |
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 | |
#encoding=utf-8 | |
import time | |
import os, sys | |
import re | |
import pickle | |
import re2 | |
re2.set_fallback_notification(re2.FALLBACK_WARNING) |
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
#include <re2/re2.h> | |
#include <iostream> | |
#include <string> | |
#include <cassert> | |
#include <stdio.h> | |
#include <vector> | |
#include <cstdlib> | |
#include <time.h> | |
#include <unistd.h> |
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
cdef inline _re2.StringPiece* _alloc_sp(self, char* cstring, Py_ssize_t& size): | |
cdef _re2.StringPiece * sp | |
sp = new _re2.StringPiece(cstring, size) | |
return sp | |
cdef inline void _dealloc_sp(self, _re2.StringPiece* sp): | |
del sp | |
cdef inline _my_match(self, _re2.StringPiece sp_zero, int pos, int size, _re2.re2_Anchor anchoring, _re2.StringPiece* submatch, int nsubmatch): | |
return self.re_pattern.Match(sp_zero, <int>pos, <int>size, anchoring, submatch, nsubmatch) |
OlderNewer