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
### Keybase proof | |
I hereby claim: | |
* I am fernandoflorez on github. | |
* I am fernandoflorez (https://keybase.io/fernandoflorez) on keybase. | |
* I have a public key ASBf8Ybpv4oA3dMGgeYHXlK0eeesMH3eTHtaIZNkaTqtrAo | |
To claim this, I am signing this object: |
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
s=lambda c=0,l=0:['Mommy','Daddy','Grandma','Grandpa'][c]+' shark'+(', '+' '.join(['doo']*6) if l<3 else '!')+'\n'+('' if c>3 else s(c,l+1) if l<3 else s(c+1,0) if c<3 else '') |
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
brew install cloc | |
cd /to/project/folder | |
cloc . |
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
$ hackon <project_name> | |
# supports autocompletion: | |
$ hackon <TAB><TAB> |
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 _hackon() { | |
local opts cur prev | |
opts=`ls -l $HOME/projects/ | egrep '^d' | awk '{print $9}'` | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) | |
return 0 | |
} | |
function hackon() { |
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 pyrax | |
if __name__ == '__main__': | |
pyrax.set_setting('identity_type', 'rackspace') | |
pyrax.set_credentials('username', 'api_key') | |
cf = pyrax.cloudfiles | |
container = cf.get_container('container_name') | |
objects = container.get_objects(full_listing=True) |
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 pyrax | |
if __name__ == '__main__': | |
pyrax.set_setting('identity_type', 'rackspace') | |
pyrax.set_credentials('username', 'api_key') | |
cf = pyrax.cloudfiles | |
container = cf.get_container('container_name') | |
container.delete_all_objects() |
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 gevent import monkey | |
from gevent.pool import Pool | |
from gevent import Timeout | |
monkey.patch_all() | |
import pyrax | |
if __name__ == '__main__': | |
pool = Pool(100) | |
pyrax.set_setting('identity_type', 'rackspace') |
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
#!/usr/bin/env python | |
# original url: https://github.com/funciton/nagios-plugins | |
import urllib2 | |
try: | |
import json | |
except ImportError: | |
import simplejson as json # NOQA | |
UNKNOWN = -1 |
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
class RedisBytecodeCache(BytecodeCache): | |
def __init__(self, conn): | |
self._conn = conn | |
def load_bytecode(self, bucket): | |
code = self._conn.get(bucket.key) | |
if code is not None: | |
return bucket.bytecode_from_string(code) |
NewerOlder