Skip to content

Instantly share code, notes, and snippets.

View JSantosP's full-sized avatar

Javier Santos JSantosP

View GitHub Profile
@JSantosP
JSantosP / lic_001.json
Last active March 7, 2020 17:43
Dispatcher license
{
"active" : true,
"version": "v0.1.4"
}
@JSantosP
JSantosP / TupleSum.scala
Created June 15, 2017 17:43
Scalera - Monoids aren't démodé and thursday are the new fridays
object TupleSum extends App {
// Monoids aren't démodé and thursday are the new fridays
val l = List(
1 -> 1,
2 -> 3,
3 -> 3)
//println(l.sum)
@JSantosP
JSantosP / card.scala
Last active February 2, 2017 18:06
Some cards gist
package scalera
package object card {
sealed trait Suit
object Suit {
lazy val values = List(Spades, Diamonds, Hearts, Clubs)
}
case object Spades extends Suit
case object Diamonds extends Suit
@JSantosP
JSantosP / TypeClassApproach.scala
Created April 7, 2016 16:51
Type class approach for polymorphic behavior
object TypeClassApproach extends App {
// The logic ...
trait StreamT[T]{
def values: Stream[T]
}
object StreamT {
@JSantosP
JSantosP / Boot.scala
Created April 5, 2016 14:26
New Boot for twitter-stream project. With this snippet we're able to measure NRT the number of mentions between Android and IOS
package scalera.twitter
import org.apache.spark.streaming.dstream.DStream
import twitter4j.Status
object Boot extends Analytics{
// Set checkpoint dir
ssc.checkpoint("/tmp")