have short, efficient meetings that honor the contributions of all members
prevent many failure modes that derail meetings, including:
- going too long
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
"""use get_logger: | |
from this_logging import get_logger; logger = get_logger(__name__) | |
# then you can: | |
logger.debug("foo") | |
# and if you want to change the logging level: | |
import logging | |
logger.parent.setLevel(logging.DEBUG) | |
""" | |
from os.path import dirname, join, exists | |
import logging |
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 paste.httpserver import ThreadPool | |
pool = ThreadPool(5) | |
import random | |
import time | |
def do_work(t): | |
print 'about to sleep for %s sec' % (t,) | |
time.sleep(t) | |
print 'slept for %s' %(t) |
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 | |
# tested on osx, mostly | |
# tested on ubuntu | |
# | |
# to use: /bin/bash -xc "$( curl -fsSL 'https://raw.github.com/gist/1146774' )" | |
# | |
# | |
set -o errexit |
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 RoleHostsGenerator(object): | |
""" generator for the env.hosts dictionary""" | |
def __init__(self,hostfile=HOSTS_FILE): | |
self.hostfile=HOSTS_FILE | |
def __getitem__(self,key): | |
print self.hostfile | |
print key | |
l = list(_gethosts(key,open(self.hostfile))) | |
print l |
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 RoleHostsGenerator(object): | |
""" generator for the env.hosts dictionary""" | |
def __init__(self,hostfile=HOSTS_FILE): | |
self.hostfile=HOSTS_FILE | |
def __getitem__(self,key): | |
print self.hostfile | |
print key | |
l = list(_gethosts(key,open(self.hostfile))) | |
print l |
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
""" | |
$ fab -f blah.py -H web03 somefun | |
[web03] Executing task 'somefun' | |
[web03] sudo: uname -a | |
Fatal error: Name lookup failed for web03 | |
Aborting. | |
would have aborted, but env.ignore_abort 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
#!/usr/bin/env python | |
""" | |
Example fabfile for PyMNtos September 2011 meeting. | |
some examples of usage: | |
$ fab -H somehost -- uname -a | |
$ fab -H somehost run:'uname -a' | |
$ fab -d example |
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 discussion of bring the block to the iterator at | |
# http://mettadore.com/ruby/ruby-blocks-seeking-closure/ | |
## Ruby Version | |
''' | |
class Kids < Array | |
def each_one | |
self.each_with_index do |n, i| | |
yield(n) |
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
""" | |
Sketch of proposed behaviour... make 'list of dicts' | |
create a (potentially) 'ragged' array, with autoguessed column names, | |
and sensible default values, where the keys don't match. | |
Current behaviour | |
In [215]: pandas.DataFrame([dict(a=1),dict(a=2)],columns=['a']) | |
Out[215]: | |
a |