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
object Helpers { | |
def time[R](block: => R): (R, Long) = { | |
val t0 = System.nanoTime() | |
val result = block // call-by-name | |
val t1 = System.nanoTime() | |
(result, t1 - t0) | |
} | |
} | |
case class Memoize[-T , +R : ClassTag](duration : Duration, refreshOnGet : Boolean = false)(f: T => R) | |
(implicit app : Application) extends (T => R) { |
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
db.getAllRemembered(function (err, remembered){ | |
db.getDriversCount(function (err, driversCount) { | |
db.getFreeDriversCount(function (err, freeDriversCount) { | |
db.getFinishedRidesCount(function (err, finishedRidesCount) { | |
db.getRides(function (err, rides) { | |
db.getMessages(0,-1,function (err, messages) { | |
db.getHeat(function (err, heat) { | |
var arr = []; | |
for (var driverId in rides) { | |
var driver = driver_list.getDriver(driverId); |
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 services | |
import reactivemongo.bson.BSONObjectID | |
// Not unused at all. Do not delete | |
import play.modules.reactivemongo.json.BSONFormats._ | |
object JsonFormats { | |
import play.api.libs.json.Json |
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 javax.sound.sampled.ReverbType | |
import Cell.Percent | |
import scala.util.Random | |
trait Revealable { | |
var caster: Option[Cell] = None | |
def reveal()(implicit isBomb : Boolean, bombCount : Int) | |
def subscribe(caster:Cell): Unit ={ |
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
commit = (cb) -> exec "git commit -am 'auto-v#{pkg.version}'", cb | |
upgrade = (cb) -> exec "npm version patch", cb | |
build = (cb) -> exec "cordova build", cb | |
copy = (cb) -> exec "cp ./platforms/android/ant-build/LDWorkorder-debug.apk ./#{dir}/#{pkg.name}-#{pkg.version}.apk", cb | |
commit -> upgrade -> build -> copy -> done |
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 akka.actor.IO._ | |
import akka.actor.{Props, IO, IOManager, Actor, ActorSystem} | |
import akka.event.Logging | |
import akka.util.ByteString | |
import java.net.InetSocketAddress | |
class TCPEchoServer(port: Int) extends Actor { | |
val log = Logging(context.system, this) | |
val state = IterateeRef.Map.async[IO.Handle]()(context.dispatcher) |
NewerOlder