Skip to content

Instantly share code, notes, and snippets.

@ryanlecompte
ryanlecompte / gist:5537188
Last active December 17, 2015 02:38
Pimping Iterable to have zipMany/unzipMany operations
// Usage examples:
val a = Vector(1,2,3).zipMany(Vector(1,2,3), Vector(5,6,7), Vector(8,9,10), Vector(11,12,13))
Vector(Vector(1, 1, 5, 8, 11), Vector(2, 2, 6, 9, 12), Vector(3, 3, 7, 10, 13))
a.unzipMany
Vector(Vector(1, 2, 3), Vector(1, 2, 3), Vector(5, 6, 7), Vector(8, 9, 10), Vector(11, 12, 13))
// Implementation
import scala.collection._
import scala.collection.generic.CanBuildFrom
autoCompilerPlugins := true
addCompilerPlugin("org.scala-lang.plugins" % "continuations" % "2.9.1")
scalacOptions += "-P:continuations:enable"
@persson
persson / tmuxed_pipelines.sh
Created October 4, 2011 04:28
tmux script to create single local tmux session attached to many remote tmux sessions
#!/bin/sh
#Yes, there is no six
hosts=(pipe1 pipe2 pipe3 pipe4 pipe5 pipe7 pipe8 pipe9)
names=(pipe1 pipe2 pipe3 pipe4 pipe5 pipe7 pipe8 pipe9)
sessions=(1 2 3 4 5 7 8 9)
tmux new-session -d -s pipelines
i=0