Skip to content

Instantly share code, notes, and snippets.

View ahoy-jon's full-sized avatar
🐋
Thinking!

Jonathan Winandy ahoy-jon

🐋
Thinking!
View GitHub Profile
@ahoy-jon
ahoy-jon / master_scultpure.ino
Created August 28, 2016 09:37
Some Arduino Scripts
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 4);
void setup() {
scalaVersion := "2.11.8"
name := "datacrunch"
val sparkV = "1.6.1"
libraryDependencies ++= Seq(
@ahoy-jon
ahoy-jon / testspark16.scala
Created June 26, 2016 21:29
Spark Datasets Api + Shapeless Tags
package com.cym_iot.training.testspark16
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
import org.apache.spark.sql.{Dataset, Encoder, SQLContext}
import org.apache.spark.{SparkConf, SparkContext}
import shapeless.tag
import shapeless.tag.@@
{ "hash": "2b981d4db4f698bcea7266b0bf68bfb4",
"schema":
{ "type":"record",
"name":"schemaCreated",
"namespace":"com.cym_iot.model",
"fields":[
{"name":"hash","type":{"type":"string", "logicalType":"hex/md5"}},
{"name":"schema","type":"avroSchema"}]}}
case class Result[+T](nominal: Option[T],
annotations: Vector[Annotation])
// eg: userid=123 => QId("user",123)
case class QId(idFieldname: String,
value: String)
case class Anchor(path: String @@ AnchorPath,
ai
aie
aient
aies
ait
as
au
aura
aurai
auraient
import java.util.Date
import org.apache.spark._
import org.apache.spark.sql.{DataFrame, SQLContext}
import shapeless.tag.@@
import scala.collection.immutable.Range.Inclusive
@ahoy-jon
ahoy-jon / part0.scala
Last active October 28, 2015 21:40
Présentation au PSUG, avec Scalaz, Shapeless, et aussi 2 projets en cours : autobuild https://github.com/ahoy-jon/autoBuild et excelsius https://github.com/ahoy-jon/excelsius
package psug.part0
import scala.language.higherKinds
class Part0 {
/**
* HELLO PSUG !!!
*
* MY NAME IS AHOY-JON
import shapeless.contrib.scalaz.Sequencer
import shapeless.labelled._
import shapeless.ops.hlist.Mapper
import shapeless.syntax.singleton._
import shapeless._
import scala.language.higherKinds
import scalaz.{Apply, Applicative, Functor}
lazy val macros = project.in(file("macros"))
lazy val root = project.in(file(".")).dependsOn(macros)