This file contains hidden or 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 __future__ import print_function | |
import gevent | |
from time import sleep | |
def ex1(): | |
print('Example 1') | |
# synchronous | |
def f1(): | |
for i in xrange(10): | |
print('f1', i) |
This file contains hidden or 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 __future__ import print_function | |
import gevent | |
from time import sleep | |
def ex1(): | |
print('Example 1') | |
# synchronous | |
def f1(): | |
for i in xrange(10): | |
print('f1', i) |
This file contains hidden or 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 gevent | |
def myfunc(): | |
print 'RARWARAWRARR' | |
def rawr(a): | |
return sum(a) | |
g = gevent.Greenlet(rawr, [1, 2]) | |
g.link(myfunc) |
This file contains hidden or 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 gevent | |
def myfunc(r): | |
print 'RARWARAWRARR' | |
def rawr(a): | |
return sum(a) | |
g = gevent.Greenlet(rawr, [1, 2]) | |
g.link(myfunc) |
This file contains hidden or 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
{ | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "https://github.com/Ivoz/cakephp" | |
}, | |
{ | |
"packagist": false | |
} | |
], |
This file contains hidden or 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
## Install CakePHP 2.2.1 through composer :D | |
# requires zip, phar php extensions | |
mkdir caketmp && cd caketmp | |
curl -s https://getcomposer.org/installer | php # get the composer.phar installer | |
wget https://gist.github.com/raw/3433079/a38e8d444d3c99471e5bcdcadf689b0c676ae131/composer.json # loads my custom repo with the cake core files | |
./composer.phar install # downloads CakePHP as a library | |
bin/cake bake . # install cake in current dir, using the ln'ed script composer has made |
This file contains hidden or 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
#!/bin/bash | |
# Color shortcuts | |
co_black='\[\e[30m\]' | |
co_red='\[\e[31m\]' | |
co_green='\[\e[32m\]' | |
co_yellow='\[\e[33m\]' | |
co_blue='\[\e[34m\]' | |
co_purple='\[\e[35m\]' | |
co_cyan='\[\e[36m\]' | |
co_white='\[\e[37m\]' |
This file contains hidden or 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
# Virtualenvwrapper settings | |
export WORKON_HOME=~/.virtualenvs | |
export PROJECT_HOME=~/code | |
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2 | |
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/bin/virtualenv | |
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages' | |
#export PIP_REQUIRE_VIRTUALENV=true | |
export PIP_RESPECT_VIRTUALENV=true | |
export PIP_VIRTUALENV_BASE=$WORKON_HOME | |
source /usr/bin/virtualenvwrapper.sh |
This file contains hidden or 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 scm_branch { | |
if git branch &>/dev/null; then | |
git branch | grep '*' | cut -c 3- | |
echo -n ' ' | |
fi | |
if hg root &>/dev/null; then | |
hg summary | head -n 2 | tail -n 1 | cut -d ' ' -f2 | |
echo -n ' ' | |
fi | |
} |
This file contains hidden or 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
#!/bin/bash | |
# Color shortcuts | |
co_black='\[\e[30m\]' | |
co_red='\[\e[31m\]' | |
co_green='\[\e[32m\]' | |
co_yellow='\[\e[33m\]' | |
co_blue='\[\e[34m\]' | |
co_purple='\[\e[35m\]' | |
co_cyan='\[\e[36m\]' | |
co_white='\[\e[37m\]' |