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", |
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._,Keys._ | |
import PlayProject._ | |
object Build extends sbt.Build { | |
val appName = "hoge" | |
val appVersion = "1.0-SNAPSHOT" | |
val appDependencies = Seq ( | |
) |
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
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
object Application extends Controller { | |
def index = Action { | |
Ok(views.html.index()) | |
} |
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
-- http://stackoverflow.com/questions/1124603/grouped-limit-in-postgresql-show-the-first-n-rows-for-each-group | |
-- http://www.postgresql.jp/document/9.2/html/tutorial-window.html | |
CREATE TABLE empsalary ( | |
depname varchar(10) not null | |
, empno integer not null | |
, salary integer not null | |
); | |
INSERT INTO empsalary (depname, empno, salary) VALUES ('develop', 11, 5200); |
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
scala> scala.collection.mutable.Map.empty[Int, Int].withDefaultValue(0) | |
res0: scala.collection.mutable.Map[Int,Int] = Map() | |
scala> res0(1) | |
res1: Int = 0 | |
scala> res0.toMap | |
res2: scala.collection.immutable.Map[Int,Int] = Map() | |
scala> res2(1) |
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/sh | |
exec scala "$0" "$@" | |
!# | |
import util.control.Breaks | |
val continue = new Breaks | |
Breaks.breakable { |
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
scala> "a".format(_) | |
res0: Any* => String = <function1> | |
scala> "a".format(_: String) | |
res1: String => String = <function1> | |
scala> "a".format(_: String, _: String) | |
res2: (String, String) => String = <function2> | |
scala> "a".format(_: String, _: String, _: Int) | |
res3: (String, String, Int) => String = <function3> |