Perform a random selection (weighted) of ingredients from the data files.
Update the ingredient files and run! The script will automatically decrement the weights of its selections to promote new items.
#!/usr/bin/env bash | |
# | |
# rebalance-partitions-expand | |
# | |
# This script will re-balance all partitions of the specified topics in a Kafka cluster | |
# with a strategy that assumes one or more new brokers have been added. | |
# | |
# This goal of this script is to "expand" the partitions across all the new brokers | |
# to even out distribution. | |
# |
### Keybase proof | |
I hereby claim: | |
* I am ahawker on github. | |
* I am hawker (https://keybase.io/hawker) on keybase. | |
* I have a public key ASD6wGH9jznfLABTvGu3WN9nfmKR6PwDFLe54ahD7HkDqwo | |
To claim this, I am signing this object: |
""" | |
CracklePop | |
~~~~~~~~~~ | |
A simple fizzbuzz alternative for RC. | |
Usage: `python3 cracklepop.py` | |
""" | |
import sys |
using System; | |
using System.IO; | |
using Microsoft.Win32.SafeHandles; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace Test | |
{ |
NO_OP = lambda *args, **kwargs: True | |
def iterable(item): | |
""" | |
Return an iterable which contains the given item. | |
""" | |
if isinstance(item, collections.Iterable) and not isinstance(item, basestring): | |
return item | |
return (item,) if item is not None else () |
import crython | |
import time | |
@crython.job(second='*') #fired every second | |
def hello_world(): | |
print 'hello_world called every second.' | |
@crython.job(second='*/4') #fired every 4 seconds | |
def hello_fours(): | |
print 'hello_fours called every 4 seconds.' |
#!/usr/bin/env python | |
def main(): | |
for x in xrange(1, 101): | |
div3 = x % 3 == 0 | |
div5 = x % 5 == 0 | |
if div3 and div5: | |
print 'FizzBuzz' | |
elif div3: | |
print 'Fizz' |