Skip to content

Instantly share code, notes, and snippets.

View filippovitale's full-sized avatar

Filippo Vitale filippovitale

View GitHub Profile
@filippovitale
filippovitale / keybase.md
Created August 16, 2014 09:47
Keybase proof

Keybase proof

I hereby claim:

  • I am filippovitale on github.
  • I am filippovitale (https://keybase.io/filippovitale) on keybase.
  • I have a public key whose fingerprint is D500 122C 2E12 6B3F E9B7 1577 051C 7654 7F1C 75E1

To claim this, I am signing this object:

Verifying that +filippovitale is my Bitcoin username. You can send me #bitcoin here: https://onename.io/filippovitale
/**
* reference: http://www.cs.ox.ac.uk/ralf.hinze/publications/GGTries/Encode.lhs
*/
object GenTrie {
sealed trait Bit
case object △ extends Bit
case object ▲ extends Bit
type Bits = List[Bit]
@filippovitale
filippovitale / gist:cba86684cc8dace2b854
Created February 10, 2015 09:57
Source code related to the presentation: "Will it blend?" - ScalaSyd Episode 33 - February 2015
import org.scalameter.api._
import scala.collection.mutable
/**
* Source code related to the presentation: "Will it blend?"
* ScalaSyd Episode 33 - February 2015
*/
class BlendBenchmark extends PerformanceTest.OfflineReport {
@filippovitale
filippovitale / xml
Created February 27, 2015 00:29
./Library/LaunchAgents/homebrew.mxcl.kafka.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
<key>SERVER_JVMFLAGS</key>
<string>-Dapple.awt.UIElement=true</string>
import org.specs2._
import scalaz.syntax.id._
/**
* https://github.com/swlaschin/PropertyBasedTesting/blob/master/part2.fsx
*/
class Examples extends Specification with ScalaCheck {
def is = commutative ^ inverse ^ easyToVerify ^ invariant ^ structuralInduction ^ idempotent ^ oracle
/**
  1. General Background and Overview
@filippovitale
filippovitale / SendMoreMoneySpec.scala
Created July 6, 2015 12:16
Send + More = Money – ScalaSyd – July 2015
import org.specs2._
import scalaz._, Scalaz._
class SendMoreMoneySpec extends Specification { def is = s2"""
Using the List Monad
List(1, 2) $tl1
List(1, 2) if a != b $tl2
List(1, 2, 3) $tl3
Map('a' -> a, 'b' -> b) $tl4
s.eval(List(1, 2)) $ts1
@filippovitale
filippovitale / folds.scala
Last active August 29, 2015 14:26 — forked from tonymorris/folds.scala
Fold exercises in Scala
trait MyOption[A] {
def fold[B](n: => B, s: A => B): B
// Define the usual Option API.
//
// * Constructors (on the object)
// some
// none
// * methods
// map
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.