Skip to content

Instantly share code, notes, and snippets.

View ThibautGery's full-sized avatar

Thibaut ThibautGery

View GitHub Profile
@ThibautGery
ThibautGery / index.js
Last active July 19, 2017 04:36
Ramba currying bug with reduce
const R = require('ramda');
const test = require('ava');
//not working
const fromListToMap = R.reduce((acc, attr) => {
acc[attr.name] = attr.value
return acc
}, {})
//working
import scala.concurrent.duration._
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._
class TodoListSimulation extends Simulation {
val httpProtocol = http
@ThibautGery
ThibautGery / TakeWhileBenchmark.scala
Created March 4, 2017 03:38
Benchmark to check the execution time of takeWhile using local state and local immutable structure
class TakeWhileBenchmark {
def takeWhile1[A](list: List[A])(f: A => Boolean): List[A]= {
@tailrec
def go(list: List[A], acc: List[A]): List[A] = {
list match {
case x :: xs if f(x) => go(xs, x :: acc)
case _ => acc
}
}
@ThibautGery
ThibautGery / item1.json
Last active June 8, 2016 16:15
ElasticSearch Query
{
"request_at": "2014-11-03T10:00:00Z",
"request_hierarchy": [
"0/127.0.0.1/",
"1/127.0.0.1/hello"
]
}