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
| optional[String, Int](S.param("optional"), Helpers.asInt(_)) |
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
| http x((:/ ("www.mysite.com") / "upload") << | |
| ("file", new java.io.File("""path\to\file\""")) as_str) | |
| } |
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
| java -Xmx512M -jar $SBT_LAUNCHER "$@" |
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 sbt._ | |
| import Default._ | |
| libraryDependencies <++= (scalaVersion, sbtVersion) { | |
| case (scalaVersion, sbtVersion @ "0.11.0") => Seq( | |
| sbtPluginExtra("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT", sbtVersion, scalaVersion), | |
| sbtPluginExtra("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0-SNAPSHOT", sbtVersion, scalaVersion) | |
| ) | |
| case (scalaVersion, sbtVersion @ "0.11.1") => Seq( |
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 sbt._ | |
| import Defaults._ | |
| libraryDependencies <++= (scalaVersion, sbtVersion) { | |
| case (scalaVersion, sbtVersion @ "0.11.0") => Seq( | |
| sbtPluginExtra("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT", sbtVersion, scalaVersion), // corresponds to addSbtPlugin("name.heikoseeberger.groll" % "groll" % "0.4.0-SNAPSHOT") | |
| sbtPluginExtra("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0-SNAPSHOT", sbtVersion, scalaVersion) | |
| ) | |
| case (scalaVersion, sbtVersion @ "0.11.1") => Seq( |
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
| /* | |
| * Copyright 2011 Typesafe Inc. | |
| * | |
| * This work is based on the original contribution of WeigleWilczek. | |
| * | |
| * Unless otherwise agreed, training materials may only be used for | |
| * educational and reference purposes by individual named participants | |
| * in a training course offered by Typesafe or a Typesafe training partner. | |
| * Unauthorized reproduction, redistribution, or use of this material is prohibited. | |
| */ |
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
| package org.scalatrain | |
| object TestData { | |
| val List(munich, nuremberg, essen, cologne) = | |
| List("Munich", "Nuremberg", "Essen", "Cologne") map { Station(_) } | |
| val (t722, t724) = ("722", "724") | |
| val times: Map[String, Map[Station, Time]] = Map( | |
| t722 -> Map( |
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 sbt._ | |
| import sbt.Keys._ | |
| import com.typesafe.sbtscalariform.ScalariformPlugin._ | |
| object Build extends Build { | |
| lazy val scalatrain = Project( | |
| "scalatrain", | |
| file("."), | |
| settings = |
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
| package misc | |
| class PhoneMnemonics(words: Set[String]) { | |
| val codeToChars: Map[Char, String] = | |
| Map( | |
| '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", | |
| '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ" | |
| ) |
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
| // After having run eclipse with-sources=true from sbt (with sbteclipse) .classpath should contain sourcepaths: | |
| val eclippseCp = scala.xml.XML.load(".classpath") | |
| val entries = eclippseCp.child filter { _.label == "classpathentry" } | |
| val sources = entries flatMap { _.attributes filter { _.key=="sourcepath" }} map { _.value.text } | |
| val destDir = "~/ensime-sources" // feel free to modify this | |
| def fileName(file: String) = new java.io.File(file).getName.replace("-sources.jar", "") | |
| import java.io.File |