Skip to content

Instantly share code, notes, and snippets.

View sbromberger's full-sized avatar

Seth Bromberger sbromberger

View GitHub Profile
@cmccandless
cmccandless / pipeline.py
Last active February 27, 2019 01:25
Pipeline Demo
class Job():
def __init__(self, *args, **kwargs):
pass
def __call__(self, data):
raise NotImplementedError()
class Square(Job):
def __call__(self, data):
return [d * d for d in data]
@ramn
ramn / PrimeGenerator.scala
Last active September 19, 2019 08:14
Prime generator in Scala
val primes: Stream[Int] = 2 #:: Stream.from(3).filter { n => !primes.takeWhile(_ <= math.sqrt(n)).exists(n % _ == 0) }
def isPrime(n: Int) = primes.dropWhile(_ < n).head == n