Skip to content

Instantly share code, notes, and snippets.

package com.example
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.http.scaladsl.server.RouteResult.route2HandlerFlow
import com.typesafe.config.ConfigFactory
@mfirry
mfirry / EdnPickleFormat
Created April 15, 2015 12:37
Foolin' around with the idea that Pickling could work with EDN
package scala.pickling
import scala.pickling.internal._
import scala.language.implicitConversions
package object edn extends EdnFormats {
}
package edn {
import scala.reflect.runtime.universe._
@mfirry
mfirry / 0.96
Last active August 28, 2024 16:36
∙ ./gradlew -Dairpal.prestoVersion=0.96 clean shadowJar -Dairpal.useLocalNode 21:16 marco@mymachine
:cleanAssets UP-TO-DATE
:clean
:nodeSetup SKIPPED
:installAssets
:buildAssets
[21:18:03] Using gulpfile ~/playground/airpal/src/main/resources/assets/gulpfile.js
[21:18:03] Starting 'browserify'...
[21:18:03] Bundling app.js...
[21:18:03] Bundling plugin.js...
@mfirry
mfirry / HttpGate
Created February 25, 2015 17:18
Example using akka-http with SprayJson
package com.example
import akka.actor.ActorSystem
import akka.http.Http
import akka.http.marshalling.ToResponseMarshallable.apply
import akka.http.server.Directive.addByNameNullaryApply
import akka.http.server.Directive.addDirectiveApply
import akka.http.server.Directives.IntNumber
import akka.http.server.Directives.complete
import akka.http.server.Directives.get
@mfirry
mfirry / test_array
Created January 28, 2015 15:23
Weird error: this gives compilation error: the trait `core::ops::Index<u64>` is not implemented for the type `[i64]` [E0277]
fn get_n(array: &[i64; 4], position: u64) -> i64 {
array[position];
}
@mfirry
mfirry / HadoopSimpleExample
Created December 4, 2014 09:05
Simple example using TinkerPop3 with gremlin-scala
import com.tinkerpop.gremlin.hadoop.structure.HadoopGraph
import com.tinkerpop.gremlin.scala._
import scala.util.Random
import com.tinkerpop.gremlin.process.T
object HadoopSimpleExample extends App {
val graph: HadoopGraph = HadoopGraph.open()
val gs = GremlinScala(graph)
(1 to 5) foreach { i =>