This file contains 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
ps auxw | awk '{ g[$11 " " $12] += $6 } END { for (i in g) { print g[i] "\t" i }}' | sort -bgr |
This file contains 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
/** | |
* actor wrapping access for browser socket | |
*/ | |
class BrowserSocket( | |
val s: WebSocketConnection, | |
val userId: Long, | |
val teamId: Long | |
) extends Actor { |
This file contains 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
object RichF { | |
implicit class RichF1[A, Z](val f: A => Z) extends AnyVal { | |
def map[Y](g: Z => Y): A => Y = | |
(a: A) => g(f(a)) | |
def flatMap[Y](g: Z => A => Y): A => Y = | |
(a: A) => g(f(a))(a) | |
} | |
implicit class RichF2[A, B, Z](val f: (A, B) => Z) extends AnyVal { | |
def map[Y](g: Z => Y): (A, B) => Y = |
This file contains 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 | |
PID_FILE=/var/run/fluentd.pid | |
CONF_FILE=/etc/fluent/fluent.conf | |
LOG_FILE=/var/log/fluent/fluent.log | |
DEFAULT_RVM_PATH=/usr/local/rvm | |
JEMALLOC=jemalloc.sh | |
F_USER=fluentd | |
F_GROUP=fluentd |
This file contains 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
object Euler0009 { | |
private val max = 1000 | |
def main(args: Array[String]): Unit = { | |
println( | |
buildTriplets(1, 2, Nil).filter(_.isPitagolyan).map(_.product) | |
) | |
} |
This file contains 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
scalaVersion := "2.10.0" | |
// Let's support all "modern" Scala versions. | |
crossScalaVersions := Seq( | |
"2.9.3-RC1", | |
"2.9.2", | |
"2.9.1", "2.9.1-1", | |
"2.9.0", "2.9.0-1", | |
"2.8.0", "2.8.1", "2.8.2" | |
) |
This file contains 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
class ClusterMetricsElasticScaleListener extends Actor with ActorLogging { | |
val selfAddress = Cluster(context.system).selfAddress | |
override def preStart(): Unit = | |
Cluster(context.system).subscribe(self, classOf[ClusterMetricsChanged]) | |
override def postStop(): Unit = | |
Cluster(context.system).unsubscribe(self) | |
def receive = { |
This file contains 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 scala.language.postfixOps | |
import scala.concurrent._ | |
import scala.concurrent.duration._ | |
import akka.pattern.pipe | |
import akka.actor._ | |
import akka.cluster.routing._ | |
/** | |
* Concept and some code lifted from | |
* https://github.com/jsuereth/intro-to-fp, thanks Josh! |
This file contains 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 sbt._ | |
import Keys._ | |
import Build.data | |
object build extends Build { | |
lazy val runAll = TaskKey[Unit]("run-all") | |
lazy val standardSettings = Seq( | |
runAllIn(Compile) | |
) |
This file contains 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
using System; | |
using System.Collections.Generic; | |
namespace Utils | |
{ | |
public class UnknownTypeException : Exception | |
{ | |
} | |
public class TypeRegistry |