This blog post series has moved here.
You might also be interested in the 2016 version.
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
object NettyFutureBridge { | |
import scala.concurrent.{ Promise, Future } | |
import scala.util.Try | |
import java.util.concurrent.CancellationException | |
import org.jboss.netty.channel.{ Channel, ChannelFuture, ChannelFutureListener } | |
def apply(nettyFuture: ChannelFuture): Future[Channel] = { | |
val p = Promise[Channel]() | |
nettyFuture.addListener(new ChannelFutureListener { | |
def operationComplete(future: ChannelFuture): Unit = p complete Try( |
class MyManagedResource extends ResourceController[String] { | |
def index = Action(Ok("index")) | |
def newScreen = Action(Ok("new")) | |
def create = Action { | |
Redirect(MyInjectableResource.reverseRoutes.index()) | |
} | |
def show(id: String) = Action(Ok("Show " + id)) |
/** | |
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com> | |
*/ | |
package akka.contrib.mailbox | |
import scala.concurrent.duration._ | |
import java.util.concurrent.atomic.AtomicInteger | |
import java.util.concurrent.atomic.AtomicLong | |
import com.typesafe.config.Config | |
import akka.actor.{ ActorContext, ActorRef, ActorSystem, ExtendedActorSystem } |
/** | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2013-2015 Andrew Snare, Age Mooij | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This blog post series has moved here.
You might also be interested in the 2016 version.
// Inspired by a tweet from @trautonen 1/13/2016 | |
// Use Source.unfoldAsync to turn paginated database results into an akka-streams Source | |
// unfold is the inverse of fold | |
case class Page[T](pageNumber:Long, totalPages:Long, contents:List[T]) | |
case class Thing(id: Long, name: String = "foo") | |
val totalPages = 5 // | |
val pageSize = 3 |
Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
The following describes how you can publish artifacts for any sbt project using the GitHub Package Registry and the sbt-github-packages plugin.
In your GitHub account, go to Settings > Developer settings > Personal access tokens, then click on Generate new token (or click here). Fill in some sort of meaningful name (I chose Dev) and click on the write:packages
checkbox: