Skip to content

Instantly share code, notes, and snippets.

@Tukki
Tukki / gist:fa9eeff81e2fe9f2868c
Created November 29, 2015 06:40
linux查看目录大小
du -hsc *
@Tukki
Tukki / gist:89db933126b7796130ec
Created January 14, 2016 06:57
在virtualenv里面使用bpython
http://stackoverflow.com/questions/11172379/python-and-bpython-using-different-pythonpaths-in-virtualenv
在virtualenv里面安装, 或修改 .bash/.zshrc
bpython() {
if test -n "$VIRTUAL_ENV"
then
PYTHONPATH="$(python -c 'import sys; print ":".join(sys.path)')" \
command bpython "$@"
else
Error: jedi-vim failed to initialize Python: jedi#setup_py_version: Vim(pyfile):Traceback (most recent call last): (in function jedi#init_python[3]..<SNR>90_init_python[48]..jedi#setup_py_version, line 18)
各种修复, 重装无果, 最后把root权限下的thefuck, colorama 卸载掉, 修复..
https://github.com/davidhalter/jedi-vim/issues/526
@Tukki
Tukki / setattr_test.py
Last active September 26, 2016 11:23
python setattr test
# _*_ coding: utf-8 _*_
# http://stackoverflow.com/questions/12798653/does-setattr-and-getattr-slow-down-the-speed-dramatically
# run: time python setattr_test.py
class O(object):
pass
o = O()
for i in xrange(10000000):
setattr(o, 'a', 1) # python setattr_test.py 1.44s user 0.01s system 99% cpu 1.449 total
@Tukki
Tukki / .cvimrc
Last active August 30, 2018 09:49
my cVim config
" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"