I hereby claim:
- I am antoncohen on github.
- I am antoncohen (https://keybase.io/antoncohen) on keybase.
- I have a public key whose fingerprint is 5FE2 8B02 08DD 85F8 18C8 E6C9 51D1 1262 B610 78BE
To claim this, I am signing this object:
#!/usr/bin/env python | |
"""Hash files, like md5sum or shasum, only faster. Works with all | |
hash functions Python's hashlib supports.""" | |
from __future__ import print_function | |
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter | |
from hashlib import algorithms_available | |
from hashlib import new as new_hash | |
from io import open |
from multiprocessing import Pool, cpu_count | |
from random import randint | |
from time import sleep | |
class RandSleep(object): | |
"""multiprocessing.Pool.imap* needs to pickle the function it send to the | |
processes. It can't pickle functions or instance methods. But oddly it | |
can pickle instances of custom classes. So write the function as a | |
callable class.""" |
from multiprocessing.dummy import Pool as ThreadPool | |
from random import randint | |
from time import sleep | |
def increasing_sleeps(): | |
"""Pointless function to show using your own generator""" | |
for i in xrange(10): | |
yield i |
I hereby claim:
To claim this, I am signing this object:
class role::lb { | |
class { 'nginx': } | |
class { 'memcached': | |
max_connections => 4096 | |
} | |
} |
--- | |
roles: | |
- 'role::base' | |
- 'role::lb' | |
memcached::max_memory: 64 | |
nginx::worker_processes: %{::processorcount} |
class role { | |
include stdlib | |
$roles = hiera_array('roles') | |
# Require base first in case it is needed by other classes | |
if member($roles, 'role::base') { | |
require role::base | |
} |
node default { | |
include role | |
} |
#!/usr/bin/env coffee | |
print = (line) -> process.stdout.write line + '\n' | |
for num in [99..1] | |
if num > 1 | |
print "#{num} bottles of beer on the wall, #{num} bottles of beer." | |
if num-1 > 1 | |
print "Take one down and pass it around, #{num-1} bottles of beer on the wall.\n" | |
else |