Skip to content

Instantly share code, notes, and snippets.

View evantill's full-sized avatar

Eric Vantillard evantill

View GitHub Profile
@evantill
evantill / arrow-kt-draft.kt
Last active March 8, 2018 09:40
State for comprehension sample
package draft
import arrow.*
import arrow.core.*
import arrow.data.*
import arrow.syntax.option.*
import arrow.typeclasses.*
import arrow.instances.*
typealias Stack = Option<Nel<String>>
@evantill
evantill / main_critical_extendedkeyusage_timestamping.go
Last active January 1, 2022 22:23
x509 creation in go with a critical extended flag
/*
from https://golang.org/src/crypto/tls/generate_cert.go
*/
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore

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

@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"
@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)
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 / 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] {
@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 / 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