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
// redefine read so that it returns strings | |
read = (function() { | |
var oldRead = read | |
return function(prompt) { | |
return oldRead(prompt) + ""; | |
} | |
})(); | |
// show a menu based on a input list of menu items | |
// menuItems: [{ key: 'K', action: function, desc: 'Description' }, ...] |
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 markatta | |
import java.nio.file._ | |
import java.nio.file.StandardWatchEventKinds._ | |
import java.nio.file.attribute.BasicFileAttributes | |
import collection.JavaConversions._ | |
import concurrent.duration._ | |
import akka.actor.{Cancellable, ActorRef, Actor} | |
import markatta.FileSystemWatchActor._ |
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
trait ImageResource { | |
def publicUrl: String | |
} | |
case class URLImage(source: URL) extends ImageResource { | |
def publicUrl = source.url | |
} | |
case class CDNImage(bucketName: String, key: String, cdnBaseUrl: String) extends ImageResource { | |
lazy val cdnUrl = URL(cdnBaseUrl) :+ key |
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
### Keybase proof | |
I hereby claim: | |
* I am johanandren on github. | |
* I am johanandren (https://keybase.io/johanandren) on keybase. | |
* I have a public key whose fingerprint is 06BA 5A56 D804 4A25 E78C 76A1 14C5 61AB C73E 8B6F | |
To claim this, I am signing this object: |
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 akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.marshalling.{Marshaller, ToResponseMarshaller} | |
import akka.http.scaladsl.model.HttpEntity.ChunkStreamPart | |
import akka.http.scaladsl.model.{HttpEntity, HttpResponse, MediaTypes} | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl.Source | |
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 akka.actor.{ActorSystem, ActorRef} | |
import akka.pattern.ask | |
import akka.pattern.AskTimeoutException | |
import akka.util.Timeout | |
import scala.concurrent.Future | |
import scala.concurrent.duration._ | |
import scala.io.StdIn | |
object AskWithRetry extends App { |
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 akka.actor.Actor.Receive | |
import akka.actor._ | |
import akka.cluster.Cluster | |
import akka.remote.RemoteScope | |
import com.typesafe.config.ConfigFactory | |
import scala.concurrent.Await | |
import scala.concurrent.duration.Duration | |
import scala.io.StdIn |
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 akka.actor.{Actor, ActorLogging, ActorSystem, Props} | |
import akka.cluster.Cluster | |
import akka.routing.FromConfig | |
import com.typesafe.config.ConfigFactory | |
import scala.concurrent.{Await, Future} | |
import scala.io.StdIn | |
object ClusteredRoundRobinPool extends App { |
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 akka.actor.ActorSystem | |
import akka.http.scaladsl._ | |
import akka.http.scaladsl.model.{HttpMethods, Uri, HttpRequest} | |
import akka.stream.ActorMaterializer | |
import scala.concurrent.duration._ | |
import scala.concurrent.Await | |
object Bug18797 { | |
def main(args: Array[String]): Unit = { |
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 java.io.File | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl.{Sink, Source} | |
import scala.io.StdIn |
OlderNewer