Skip to content

Instantly share code, notes, and snippets.

View SRGOM's full-sized avatar

S SRGOM

View GitHub Profile
type Result[A] = Either[ Seq[ Error ], A ] //Type of Error is immaterial
//If I have a case class Border that takes Width and Color
case class Border( width: SizeUnit, color: Color )
//then what I will invoke fn2 below as such:
//This function composese results.
//Just like apply of Border would take
// libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.0-M7" % Test
import scala.scalajs.js.Date
import org.scalajs.dom
import dom.setTimeout
import org.scalatest._
"xyz" should "abc" in {
val delayTime = 20
setTimeout( () => delayer.execute( (2, new Date ) ), delayTime )
//Mark the test as complete
val testCompletePromise = Promise[ Boolean ]()
setTimeout( () => {
testCompletePromise.success( true )
} , delayTime * 4 )
@SRGOM
SRGOM / Messages.scala
Last active August 29, 2015 14:17
Using config files for messages. License: Code usable without any restrictions.
/*
* Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
*/
package play.api.i18n
import scala.language.postfixOps
import play.api._
import scala.util.control.NonFatal
package scalatags
import scala.language.implicitConversions
import scala.collection.JavaConverters._
import scala.collection.immutable
import scalatags._
import scalatags.generic.{AttrPair, Util}
import scalatags.Text.{TypedTag, attrs}
import scalatags.Text.all._