(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| PROJECT_NAME="$1" | |
| SCALA_VERSION="2.9.1" | |
| SCALATEST_VERSION="1.6.1" | |
| MOCKITO_VERSION="1.8.5" | |
| mkdir $PROJECT_NAME | |
| cd $PROJECT_NAME | |
| 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) |
| # DOCKER-VERSION 0.4.8 | |
| FROM ubuntu:12.04 | |
| # install essentials | |
| RUN apt-get install -y -q git | |
| # Install rbenv | |
| RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ########################################## | |
| # To run: | |
| # curl -sSL https://gist.githubusercontent.com/sirkkalap/e87cd580a47b180a7d32/raw/d9c9ebae4f5cf64eed4676e8aedac265b5a51bfa/Install-Docker-on-Linux-Mint.sh | bash -x | |
| ########################################## | |
| # Check that HTTPS transport is available to APT | |
| if [ ! -e /usr/lib/apt/methods/https ]; then | |
| sudo apt-get update | |
| sudo apt-get install -y apt-transport-https | |
| fi |
Step by step to install Scala + Play Framework in Ubuntu 14.04 with Activator.
Install Scala
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.6.deb
sudo dpkg -i scala-2.11.6.deb
sudo apt-get update
sudo apt-get install scala
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
| package com.softwaremill.akka | |
| import java.time._ | |
| import akka.actor.ActorSystem | |
| import akka.stream.ActorMaterializer | |
| import akka.stream.scaladsl.Source | |
| import scala.collection.mutable | |
| import scala.concurrent.Await |
This is a proposal for a lightning talk at the Reactive 2016 conference. If you like this, star the Gist.
In regular websites, it is common to send multiple events to track user clicks. Single Page Applications change the way you look at metrics. This is a talk about a simple pattern we created at Globo.com to manage a metrics layer for http://globoplay.globo.com. The talk will cover how to track user flow using Google Analytics and other services. We solved the challenge of tying metrics and components, keeping information across pages and having global data. Also some React, React Router and React Side Effects concepts like context, higher order components, history state will be covered.
| public final class BusyApp { | |
| public static void main(String []args) throws Exception { | |
| final java.util.Random generator = new java.util.Random(); | |
| while (true) { | |
| generator.ints(1000000, 0, 100).sorted(); | |
| Thread.sleep(5000L); | |
| } | |
| } | |
| } |