This gist has been upgraded to a blog post here.
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 CassandraWrapper { | |
| import scala.language.implicitConversions | |
| import scala.language.postfixOps | |
| /** | |
| * Converts a `ResultSetFuture` into a Scala `Future[ResultSet]` | |
| * @param f ResultSetFuture to convert | |
| * @return Converted Future | |
| */ | |
| implicit def resultSetFutureToScala(f: ResultSetFuture): Future[ResultSet] = { | |
| val p = Promise[ResultSet]() |
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 core.dao | |
| import scala.concurrent.Future | |
| import play.api.Logger | |
| import reactivemongo.core.commands.LastError | |
| import reactivemongo.core.errors.DatabaseException | |
| import core.db.MongoHelper |
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
| case class ErrorMessage(message: String, cause: String) | |
| object ErrorMessage { | |
| import spray.json.DefaultJsonProtocol._ | |
| implicit val errorFormat = jsonFormat2(ErrorMessage.apply) | |
| } | |
| import spray.httpx.SprayJsonSupport._ | |
| implicit val jsonRejectionHandler = RejectionHandler { | |
| case MalformedRequestContentRejection(msg, cause) :: Nil => | |
| complete(StatusCodes.BadRequest, ErrorMessage("The request content was malformed", msg)) |
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
| # How Akka maps to EAI Patterns | |
| Might be up for debate or just plain wrong. Just some notes I scribbled down some time ago. | |
| ----------------------------------------------------------------------------------------------------------------- | |
| EAI PATTERN AKKA PATTERN REFERENCE | |
| ----------------------------------------------------------------------------------------------------------------- | |
| Point to Point Channel Regular Actor Communication http://www.eaipatterns.com/PointToPointChannel.html | |
| Event-Driven Consumer Regular Actor Receive http://www.eaipatterns.com/EventDrivenConsumer.html | |
| Message Selector Actor with Stash http://www.eaipatterns.com/MessageSelector.html |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns on recent CPU
L2 cache reference ........................... 7 ns 14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory
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 mesosphere.mesos.util.FrameworkInfo | |
| import org.apache.mesos.MesosSchedulerDriver | |
| /** | |
| * @author Tobi Knaup | |
| */ | |
| object Main extends App { |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.