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
#!/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 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 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 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 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 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 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 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 | |
# synchronous | |
def f1(): | |
for i in xrange(10): | |
print('f1', i) | |
def f2(): |
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
class Msg(object): | |
""" Represents an IRC message to be sent or decoded """ | |
def __init__(self, prefix='', cmd='', params=[]): | |
self.prefix = prefix | |
self.cmd = cmd | |
self.params = [params] if (type(params) != list) else params | |
@classmethod | |
def from_msg(cls, 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
def from_msg(msg): | |
new = Msg() | |
new.decode(msg) | |
return new |