For latest settings refer to this comment
For previous settings check this Gist revisions
- always read and follow Homebrew formulae installation instructions
trait EnvHacker { | |
/** | |
* Portable method for setting env vars on both *nix and Windows. | |
* @see http://stackoverflow.com/a/7201825/293064 | |
*/ | |
def setEnv(newEnv: Map[String, String]): Unit = { | |
try { | |
val processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment") | |
val theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment") | |
theEnvironmentField.setAccessible(true) |
import org.specs2.mutable.Specification | |
import spray.http.{HttpResponse, StatusCodes} | |
import spray.httpx.SprayJsonSupport | |
import spray.httpx.marshalling._ | |
import spray.httpx.unmarshalling._ | |
import spray.json._ | |
/*** | |
* scalaVersion := "2.11.2" | |
* |
# Use https (public access) instead of git for git-submodules. This modifies only Travis-CI behavior! | |
# disable the default submodule logic | |
git: | |
submodules: false | |
# use sed to replace the SSH URL with the public URL, then init and update submodules | |
before_install: | |
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules | |
- git submodule update --init --recursive |
implicit object ProductItemFormat extends RootJsonFormat[ProductItem] { | |
// some fields are optional so we produce a list of options and | |
// then flatten it to only write the fields that were Some(..) | |
def write(item: ProductItem) = JsObject( | |
List( | |
Some("product_number" -> item.productNumber.toJson), | |
item.ean.map(ean ⇒ "ean" -> ean.toJson), | |
Some("title" -> item.title.toJson), | |
item.description.map(description ⇒ "description" -> description.toJson), | |
Some("price" -> item.price.toJson), |
// Put this filter early in your filter chain so it can initialize and clean up | |
// the cache | |
object CacheFilter extends Filter { | |
def apply(next: RequestHeader => Future[Result])(request: RequestHeader): Future[Result] = { | |
def init = RestClient.initCacheForRequest(request) | |
def cleanup = RestClient.cleanupCacheForRequest(request) | |
// You have to be very careful with error handling to garauntee the cache gets cleaned | |
// up, or you'll have a memory leak. |
sudo wget www.scala-lang.org/files/archive/scala-2.10.4.deb | |
sudo dpkg -i scala-2.10.4.deb | |
# in case of unmet libjansi-java dependency fire: | |
# sudo apt-get install -f | |
sudo apt-get install curl | |
wget https://dl.bintray.com/sbt/debian/sbt-0.13.8.deb | |
sudo dpkg -i sbt.deb |
For latest settings refer to this comment
For previous settings check this Gist revisions
import scala.concurrent.Await | |
import scala.concurrent.Future | |
import scala.concurrent.duration.Duration | |
import scala.util.Try | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.model.ContentType | |
import akka.http.scaladsl.model.HttpCharsets | |
import akka.http.scaladsl.model.HttpEntity.Strict |
Note: This is a submission for a Reactive2015 lightning talk. If you'd like to see a lightning talk about this (or read a detailed blog post if you are not going for the conference), vote for it by starring this gist! Thanks a lot!
Performance is one of the reasons why React.js is so popular for building complex, highly interactive web applications. It became the go-to library for developers who don’t like to make compromises for technical reasons when building awesome user experiences. However even with React.js it still can be easy to hit it’s performance limits.
In this lightning talk Daniel will go beyond the basics of shouldComponentUpdate and immutable data structures and will discuss how to correctly instrument, measure and optimize performance in complex React apps. He will help you understand the overhead of different parts of the React component lifecycle, how some of it’
This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.
def example = 2 // evaluated when called
val example = 2 // evaluated immediately