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
libraryDependencies ++= Seq( | |
jdbc, | |
cache, | |
"org.scalikejdbc" %% "scalikejdbc" % "[1.7,)", // by scalikejdbc organization (@seratch, .....) | |
"org.scalikejdbc" %% "scalikejdbc-interpolation" % "[1.7,)", // by scalikejdbc organization | |
"org.scalikejdbc" %% "scalikejdbc-play-plugin" % "[1.7,)", // by scalikejdbc organization | |
"com.github.tototoshi" %% "play-flyway" % "1.0.1", // by me | |
"com.github.mumoshu" %% "play2-memcached" % "0.3.0.2", // by @mumoshu | |
"com.github.nscala-time" %% "nscala-time" % "0.6.0", // by nscala-time organization (@kmizu, @xuwei_k ...) | |
"jp.t2v" %% "play2-auth" % "0.11.0", // by @gakuzzzz |
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.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
object TaskLancher extends skinny.task.TaskLauncher { | |
register("h2-browser", (params) => { | |
val f = Future { | |
org.h2.tools.Server.main() | |
} | |
f.onFailure { case e => e.printStackTrace() } |
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
#!/usr/bin/env alpaca | |
visit("http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html") | |
click("input[type=radio]") | |
click(partialLink("macosx-x64.dmg")) |
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
/* 1.0.0 */ | |
import scala.slick.driver.PostgresDriver.simple._ | |
case class Task(id: Int, name: String) | |
object Task extends Table[Task]("task") { | |
def id = column[Int]("id") | |
def name = column[String]("name") | |
def * = id ~ name <> (Task.apply _, Task.unapply _) | |
} |
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 sbt.Keys._ | |
object ScalaoauthasyncBuild extends Build { | |
lazy val scalaoauthasync = Project( | |
id = "scala-oauth-async", | |
base = file("."), | |
settings = Project.defaultSettings ++ Seq( | |
name := "scala-oauth-async", |
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
val m1 = Map(1 -> 2, 2 -> 5, 3 -> 1) | |
val m2 = Map(2 -> 4, 3 -> 3, 4 -> 3) | |
def toMultiMap[A, B](m1: Map[A, B], m2: Map[A, B]): Map[A, Set[B]] = | |
(m1.toSeq ++ m2.toSeq).groupBy(_._1).mapValues(_.map(_._2).toSet) | |
/* | |
scala> toMultiMap(m1, m2).mapValues(_.max) | |
res0: scala.collection.immutable.Map[Int,Int] = Map(2 -> 5, 4 -> 3, 1 -> 2, 3 -> 3) | |
*/ |
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
"foo" in { | |
List(2, 4, 3, 5) must contain(2, 4, 3).only | |
} |
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
FakeApplication( | |
additionalConfiguration = Map( | |
"foo" -> List("bar", "baz").asJava | |
) | |
) |
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
ssh $(cat ~/.ssh/config | grep ^Host | perl -pe 's/Host\s+//' | canything) |
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
scalacOptions <<= scalaVersion.map { sv => | |
if (sv.startsWith("2.10")) { | |
Seq( | |
"-deprecation", | |
"-language:dynamics", | |
"-language:postfixOps", | |
"-language:reflectiveCalls", | |
"-language:implicitConversions", | |
"-language:higherKinds", | |
"-language:existentials", |