Skip to content

Instantly share code, notes, and snippets.

View evantill's full-sized avatar

Eric Vantillard evantill

View GitHub Profile

Setup Mac OS X

I'm in a hospital in Spain and my MacBook was stolen.

Hospital Commit

Now I bought a new one and need to configure it. I have an external hard drive that backup everything using Time Machine, but I don't want all the crap I had in the old one.

1. Run Software Update

import collection.mutable
import org.specs2.mutable._
class ImplicitiSpec extends Specification {
type Store=Map[String,String]
object Value {
val store = new mutable.HashMap[String,String] with mutable.SynchronizedMap[String,String]
@evantill
evantill / gist:5532308
Last active December 17, 2015 01:59
replacing all occurences of Order by Enum failed
import scalaz.Order
import scalaz.syntax.order._
case class MyRange[A: Order](l: A, h: A){
def myMethod(b: MyRange[A]): MyRange[A] = {
MyRange[A](l min b.l, h max b.h)
}
}
object MyRange {
@evantill
evantill / RefactorPuzzle.scala
Created June 12, 2013 08:48
Traverse.sequence
package puzzle
import scalaz._
import Scalaz._
import scala.language.higherKinds
/**
* Created with IntelliJ IDEA.
* User: evantill
* Date: 11/06/13
@evantill
evantill / PointBarre.scala
Created July 1, 2013 10:37
scala is better stronger faster
/**
* Created with IntelliJ IDEA.
* User: evantill
* Date: 01/07/13
* Time: 12:22
* To change this template use File | Settings | File Templates.
*/
object PointBarre extends App {
case class Point2D(x: Int, y: Int) {
@evantill
evantill / TwitterActor.scala
Created October 8, 2013 10:34
some spray RequestTransformer example with Lenses
trait SprayContribForRequestTransformer {
object HttpRequestBuilderLens {
val queryLens = new Lens[Uri, Query] {
def get(c: Uri): Query = c.query
def set(c: Uri)(f: Query): Uri = c.copy(query = f)
}
val uriLens = new Lens[HttpRequest, Uri] {
package scalaio
import shapeless._, poly._
object list extends (Id ~> List) {
def apply[T](t : T) = List(t)
}
object headOption extends (List ~> Option) {
def apply[T](l : List[T]) = l.headOption
@evantill
evantill / CompileError.scala
Last active December 27, 2015 18:09
enqueue iterable error
//scalaVersion := "2.10.3"
object CompileError {
import collection.immutable.Queue
type IntQueue = Queue[Int]
val IntQueue = Queue
val q: IntQueue = IntQueue.empty[Int]
def add(elem:Int):IntQueue = q.enqueue(elem)
@evantill
evantill / testgithub.js
Created December 12, 2013 19:27
update github from node.js
var env = require('node-env-file');
var Github = require('github-api');
var Q = require('q');
env(__dirname + '/.env');
var github = new Github({
username: "evantill",
password: process.env.GITHUB_PASSWORD,
auth: "basic"