Skip to content

Instantly share code, notes, and snippets.

Filippo Vitale filippovitale

Block or report user

Report or block filippovitale

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
filippovitale / Main.hs
Last active Apr 11, 2017
Akka Stream Flow in Eta
View Main.hs
{-# LANGUAGE MagicHash, TypeOperators, MultiParamTypeClasses, TypeFamilies, DataKinds, FlexibleContexts, OverloadedStrings, ScopedTypeVariables #-}
import Java
import Data.Char
import Data.Dynamic
import Data.Typeable
data {-# CLASS "akka.japi.function.Function" #-} Function t r = Function (Object# (Function t r))
deriving Class
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<body onload=setInterval(aaa,64)>
<canvas id="c"></canvas>
filippovitale / Snake.scala
Created Feb 27, 2017 — forked from densh/Snake.scala
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
View Snake.scala
import scalanative.native._
import SDL._
import SDLExtra._
object SDL {
type Window = CStruct0
type Renderer = CStruct0
filippovitale / tea-storm.html
Created Feb 2, 2017
Unpacked version (with comments) of the beautiful TEA STORM
View tea-storm.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Tea Storm unpacked</title>
<body onload=setInterval(paint,32)>
<canvas id=c />
filippovitale /
Created Jan 3, 2017 — forked from nicoulaj/
What signals can your JRE handle ?
# Get temp dir
tmpdir=$(mktemp -d)
# Generate test
cat > ${tmpdir}/ <<EOF
import sun.misc.Signal;
import sun.misc.SignalHandler;
public class ListenToSignal {
View Genetic Algorithm.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
filippovitale / folds.scala
Last active Aug 29, 2015 — forked from tonymorris/folds.scala
Fold exercises in Scala
View folds.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
filippovitale / SendMoreMoneySpec.scala
Created Jul 6, 2015
Send + More = Money – ScalaSyd – July 2015
View SendMoreMoneySpec.scala
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 / FreeConsole
Last active Dec 30, 2016
FreeConsole – Simplest end to end example of Coyoneda and Free Monad in Scala
View FreeConsole
import scalaz.effect.IO
import scalaz.std.function._
import scalaz.{Coyoneda, Free, Monad, State, ~>}
object NonFunctor extends App {
// my simple algebra
sealed trait Console[A]
case class PrintLine(msg: String) extends Console[Unit]
case object ReadLine extends Console[String]
View gist:5e41e4c4b466e057fa73
  1. General Background and Overview
You can’t perform that action at this time.