Skip to content

Instantly share code, notes, and snippets.

@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 =>
@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 / 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 / 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 / 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._
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 / marinetti
Created April 27, 2015 17:13
DO NOT DO IT! silly example of handling to/fro Twitter Utils' Future to Scala Futures (using https://github.com/twitter/bijection)
import com.twitter.bijection.twitter_util.UtilBijections._
import com.twitter.bijection.{ AbstractBijection, Bijection, ImplicitBijection }
import com.twitter.util.Future
import scala.concurrent._
import scala.concurrent.ExecutionContext.Implicits.global
//let's create two futures and put them in a List
val a = com.twitter.util.Future(1)

Keybase proof

I hereby claim:

  • I am mfirry on github.
  • I am mfirry (https://keybase.io/mfirry) on keybase.
  • I have a public key whose fingerprint is 4622 0E9C F178 AD98 3037 41CA DAEE B33F 8538 91C9

To claim this, I am signing this object:

@mfirry
mfirry / core.clj
Created September 4, 2015 07:48
Basic :require in Clojure
(ns test123.core
(:require [test123.limo :as l]))
(defn -main [] (l/foo "Marco"))
@mfirry
mfirry / MySchema.js
Created September 7, 2015 08:41
Foolin' around with GraphQL
import {
graphql,
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLEnumType,
GraphQLInterfaceType,
GraphQLList,
GraphQLNonNull,
GraphQLInt