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 net.liftweb.util.ActorPing | |
import net.liftweb.common.Logger | |
class Boot extends Logger { | |
def boot { | |
// where to search snippet | |
LiftRules.addToPackages("your.package") | |
... | |
val myActor = new MyActor | |
myActor ! Msg |
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
<!-- disable surefire --> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<configuration> | |
<skipTests>true</skipTests> | |
</configuration> | |
</plugin> | |
<!-- enable scalatest --> | |
<plugin> |
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.xml._ | |
def googleLocalisation(adr: String) : Option[(Double, Double)] = { | |
val url = "http://maps.google.com/maps/api/geocode/xml?sensor=false&address=" | |
val xml = XML.load(url+adr) | |
if ((xml \ "status" text) == "OK") { | |
val lat = ((xml \ "result" \ "geometry" \ "location" \ "lat") text).toDouble | |
val lng = ((xml \ "result" \ "geometry" \ "location" \ "lng") text).toDouble | |
Some((lat, lng)) | |
} else { |
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 MyProject(info: ProjectInfo) extends DefaultWebProject(info){ | |
<!-- Your dependencies here --> | |
val jetty7WebApp = "org.eclipse.jetty" % "jetty-webapp" % "7.0.2.RC0" % "test" | |
val jetty7Server = "org.eclipse.jetty" % "jetty-server" % "7.0.2.RC0" % "test" | |
val jetty7Plus = "org.eclipse.jetty" % "jetty-plus" % "7.0.2.RC0" % "test" | |
<!-- Path to jetty-env.xml --> | |
override def jettyEnvXml = Some( | |
(sourcePath / "main" / "jetty" / "jetty-env.xml").asFile | |
) |
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
<Get name="sessionHandler"> | |
<Get name="sessionManager"> | |
<Set name="refreshCookieAge">120</Set> | |
<Set name="maxCookieAge">1200</Set> | |
</Get> | |
</Get> |
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://blog.trondbjerkestrand.no/post/1114624297/automated-kindle-epub-delivery */ | |
import scala.xml._ | |
import scala.xml.transform._ | |
import scala.xml.factory.XMLLoader | |
import javax.xml.parsers.SAXParser | |
/* Avoid loading dtd for contents.xml */ | |
object MyXML extends XMLLoader[Elem] { | |
override def parser: SAXParser = { |
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
optional[String, Int](S.param("optional"), Helpers.asInt(_)) |
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 x((:/ ("www.mysite.com") / "upload") << | |
("file", new java.io.File("""path\to\file\""")) as_str) | |
} |
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
java -Xmx512M -jar $SBT_LAUNCHER "$@" |
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 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( |