Skip to content

Instantly share code, notes, and snippets.

Avatar
😘
Taking care of my daugther

Nepomuk Seiler muuki88

😘
Taking care of my daugther
View GitHub Profile
View TemperatureClient.scala
package net.gutefrage
import com.twitter.app.App
import com.twitter.conversions.time._
import com.twitter.finagle.{ThriftMux}
import com.twitter.finagle.util.DefaultTimer
import com.twitter.util.{Await, Future}
import net.gutefrage.temperature.thrift._r
/**
View TemperatureClient.scala
package net.gutefrage
import com.twitter.app.App
import com.twitter.conversions.time._
import com.twitter.finagle.{ThriftMux}
import com.twitter.finagle.util.DefaultTimer
import com.twitter.util.{Await, Future}
import net.gutefrage.temperature.thrift._r
/**
View TemperatureServer.scala
import net.gutefrage.temperature.thrift._
import com.twitter.finagle.ThriftMux
// this is the raw implementation with the twitter Future based API
val service = new TemperatureService.FutureIface {
override def add(datum: TemperatureDatum): Future[Unit] = ???
override def mean(): Future[Double] = ???
}
View temperature_service.thrift
namespace * net.gutefrage.temperature.thrift
/**
* temperature in celisus and timestamp in UTC milliseconds
*/
struct TemperatureDatum {
1: i32 celsius,
2: i64 timestamp
}
View MyAppWithFlags.scala
import com.twitter.app.App
object MyApp extends App {
// parses an integer from the "-port" flag.
// Finagle already provides an implicit Flaggable typeclass for Int
// usage: -port 9000
val port = flag[Int]("port", 8080, "port this server should use")
// parses an Env trait. See typeclass below
@muuki88
muuki88 / MyApp.scala
Created Jul 23, 2016
finagle-01-utils
View MyApp.scala
import com.twitter.app.App
object MyApp extends App {
def main() {
println("Hello, World")
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am muuki88 on github.
  • I am muki (https://keybase.io/muki) on keybase.
  • I have a public key whose fingerprint is ADDD 9B3B 0F47 EAD3 6D9B C1B9 59B7 C730 340E 30A7

To claim this, I am signing this object:

@muuki88
muuki88 / AutoPlugins.scala
Last active Aug 29, 2015
SBT Native Packager - Auto Plugins
View AutoPlugins.scala
// API proposal # 1
lazy val root = project(file(".")
.enablePlugins(SbtNativePackager, JavaServerArchetype)
.settings(
"maintainer" in Debian := "Your Name <your.name@your-company.com"
)
)
// Implementation may look like
object SbtNativePackager extends AutoPlugin
@muuki88
muuki88 / LogSearch.scala
Created Jul 28, 2013
Future Composition with Scala and Akka
View LogSearch.scala
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits._
import scala.util.{ Success, Failure }
import akka.actor._
import akka.pattern.{ after, ask, pipe }
import akka.util.Timeout
object LogSearch extends App {