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
import java.io.InputStream | |
class StringInputStream(s: String) extends InputStream { | |
private val bytes = s.getBytes | |
private var pos = 0 | |
override def read(): Int = if (pos >= bytes.length) { | |
-1 | |
} else { |
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
import annotation.tailrec | |
def optLast[A](opts: String*)(convert: String => Option[A])(implicit args: List[String]): Option[A] = { | |
val longOpts = opts filter { _ startsWith "--" } | |
val longOptsRE = longOpts.mkString("^(","|",")=(.+)").r | |
@tailrec def optLastInternal(current: Option[A], args: List[String]): Option[A] = args match { | |
case Nil => | |
current |
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
// this gist has been superseded by | |
// https://github.com/idiv-biodiversity/grid-engine-tools |
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
// this gist has been superseded by | |
// https://github.com/idiv-biodiversity/grid-engine-tools |
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
import language.higherKinds | |
import collection.GenIterable | |
import collection.generic.CanBuildFrom | |
implicit class ZipInvert[A,CC[X] <: GenIterable[X]](coll: CC[A]) { | |
def zipInvert[A1 >: A, B, That](that: GenIterable[B])(implicit bf: CanBuildFrom[CC[A], (B, A1), That]): That = { | |
val b = bf(coll) | |
val these = coll.iterator | |
val those = that.iterator |
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 | |
[[ -z $2 ]] && { | |
echo "usage $0 /path/to/movie/in /path/to/movie/out" > /dev/stderr | |
exit 1 | |
} | |
PRESET=veryslow | |
TUNE=animation | |
CRF=18 |
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 | |
cd "$(dirname "$0")" | |
[[ ! -d lib ]] && | |
mkdir lib | |
[[ ! -e lib/java-mail.jar ]] && | |
wget -q -O lib/java-mail.jar http://search.maven.org/remotecontent?filepath=com/sun/mail/javax.mail/1.5.1/javax.mail-1.5.1.jar |
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
// this gist has been superseded by | |
// https://github.com/idiv-biodiversity/grid-engine-tools |
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
// this gist has been superseded by | |
// https://github.com/idiv-biodiversity/grid-engine-tools |