Skip to content

Instantly share code, notes, and snippets.

@jcsaaddupuy
jcsaaddupuy / python_profiling.py
Created August 28, 2015 08:20
python poorman profiling
import gc
import operator
from itertools import islice
types ={}
#
objs = gc.get_objects()
for x in objs:
types[type(x)] = (types.get(type(x)) or 0) +1
@jcsaaddupuy
jcsaaddupuy / boost + libtorrent in a virtualenv
Created March 29, 2015 13:26
Install boost + libtorrent in a virtualenv
#!/bin/bash
get_boost(){
wget -c "http://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.tar.gz"
[ $? -ne 0 ] && exit 1
tar xf boost_1_57_0.tar.gz
[ $? -ne 0 ] && exit 1
pushd ./boost_1_57_0
[ $? -ne 0 ] && exit 1
./bootstrap.sh --with-python=$(which python) --prefix=$VIRTUAL_ENV
# start vim ctrlp from zsh
ctrlp() {
</dev/tty vim -c CtrlP
}
zle -N ctrlp
bindkey "^p" ctrlp
@jcsaaddupuy
jcsaaddupuy / 0_reuse_code.js
Created August 21, 2014 09:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
########### setup
## you should use a virtualenv...
## use the branch CCM of pycrypto
# git clone -b ccm git://github.com/Legrandin/pycrypto.git .
# cd pycrypto
# python setup.py build
# python setup.py install
#
# pip install sjcl
#########################
@jcsaaddupuy
jcsaaddupuy / Gitalias.sh
Created December 11, 2012 12:16
Git alias
alias gitpp='git pull && git push'
alias gits='git status'
alias gitd='git diff'
alias gita='git add'
alias gitc='git commit'
alias gitck='git checkout'
alias gitpl='git pull'
alias gitps='git push'