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 com.avaje.ebeaninternal.server.lib; | |
import java.lang.reflect.Field; | |
import java.util.Iterator; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
/** | |
* Exists to work around this issue: | |
* |
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.mvc.{Cookie, Action, Controller} | |
import play.api.libs.json._ | |
import org.apache.commons.codec.binary.Base64 | |
import play.api.libs.json.JsString | |
import play.api.data.validation.ValidationError | |
/** | |
* Used for testing stuff. |
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 utils | |
import scala.xml.Elem | |
import scala.concurrent.Future | |
import java.util.{TimeZone, Date} | |
import java.text.SimpleDateFormat | |
import java.net.URLEncoder | |
import javax.crypto.spec.SecretKeySpec | |
import javax.crypto.Mac | |
import org.apache.commons.codec.binary.Base64 |
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 org.jboss.netty.buffer.ChannelBuffer; | |
import org.jboss.netty.channel.*; | |
import org.jboss.netty.handler.codec.http.*; | |
import java.net.SocketAddress; | |
import java.util.LinkedList; | |
import java.util.concurrent.Callable; | |
public class HttpPipeliningHandler implements ChannelUpstreamHandler, ChannelDownstreamHandler { |
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 play.api.libs.iteratee.{Done, Iteratee, Enumerator} | |
import play.api.mvc._ | |
import play.api._ | |
import play.api.libs.concurrent.Execution.Implicits._ | |
object Global extends GlobalSettings { | |
override def onRouteRequest(req: RequestHeader) = { | |
// Lookup handler | |
super.onRouteRequest(req) match { |
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
Initial clean compile of entire project: | |
[info] [info] Compiling 29 Scala sources and 1 Java source to /tmp/inc-compile/target/scala-2.10/classes... | |
[info] [success] Total time: 15 s, completed Aug 28, 2013 9:43:38 PM | |
Now simulate adding a method to a controller: | |
[info] [info] Compiling 1 Scala source to /tmp/inc-compile/target/scala-2.10/classes... | |
[info] [success] Total time: 2 s, completed Aug 28, 2013 9:43:40 PM | |
Now simulate adding a new route to the routes file: | |
[info] [info] Compiling 2 Scala sources and 1 Java source to /tmp/inc-compile/target/scala-2.10/classes... |
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
// Reads for recursive path | |
def recursiveSearchReads[T : Reads](path: JsPath) = Reads[Seq[T]] { json => | |
path.apply(json).map(_.validate[T]).foldLeft[JsResult[Seq[T]]](JsSuccess(Nil)) { | |
case (JsError(a), JsError(b)) => JsError(a ++ b) | |
case (err: JsError, _) => err | |
case (_, err: JsError) => err | |
case (JsSuccess(ts, _), JsSuccess(t, _)) => JsSuccess(ts :+ t) | |
}.repath(path) | |
} |
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 com.gwtplatform.mvp.client.proxy; | |
import com.google.gwt.event.logical.shared.ValueChangeEvent; | |
import com.google.gwt.user.client.Window; | |
import com.google.inject.Inject; | |
import com.google.inject.Singleton; | |
import com.google.web.bindery.event.shared.EventBus; | |
@Singleton | |
public class Html5PushStatePlaceManager extends PlaceManagerImpl { |
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
// TEST 1: | |
// Without scrolling down, can you work out whether bar() is the return value, or a side effecting | |
// method call? | |
def test1(): Boolean = { | |
if (foo) { | |
bar() | |
} else { | |
/* | |
It is a truth universally acknowledged, that a single man in possession | |
of a good fortune, must be in want of a wife. |
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 scalaz.Reader | |
case class User(id: Int, name: String) | |
case class Interest(name: String) | |
trait Database | |
trait Attempt1 { | |
// How every explanation of Reader monad I've seen/read goes: |