Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴

Aaron Mast amast09

🌴
View GitHub Profile
@amast09
amast09 / async-examples.js
Created Oct 2, 2017
Examples referenced in async js blog post
View async-examples.js
// `series` Method Example
function eatFreeBread (bread, callback) {
setTimeout(function () {
console.log('Just ate some ' + bread + ' bread');
callback(null, {breadRating: 8});
}, 3000);
}
View TradeBot.scala
import scala.concurrent.Future
import akka.stream.{ActorMaterializer, KillSwitch, KillSwitches, ThrottleMode}
import akka.stream.scaladsl.{Keep, Sink, Source}
import akka.actor.ActorSystem
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.Random
final case class StockQuote(symbol: String, price: Int)
@amast09
amast09 / ForComprehensions.scala
Last active Jul 30, 2017
Advanced Scala for comprehensions
View ForComprehensions.scala
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Await
import scala.concurrent.duration._
import java.util.Calendar
case class Movie(name: String, year: Int, rating: BigDecimal, directorId: Int)
case class Director(id: Int, name: String, yearBorn: Int)