Skip to content

Instantly share code, notes, and snippets.

@ant8e
ant8e / Crockford32.scala
Last active July 14, 2023 11:55
Crockford32
/*
* Copyright 2023 Antoine Comte
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ant8e
ant8e / ws.sc
Created November 7, 2014 13:34
import scala.reflect.runtime.universe._
object O {
def foo[A: TypeTag](xs: List[A]): String = xs match {
case c: List[String] if typeOf[A] <:< typeOf[String] => c.mkString(" ")
case c: List[Double] if typeOf[A] <:< typeOf[Double] => c.map(_.toString + "d").mkString (" ")
case _ => "Error"
}
}

Keybase proof

I hereby claim:

  • I am ant8e on github.
  • I am antoinecomte (https://keybase.io/antoinecomte) on keybase.
  • I have a public key ASBGVfybQgjOz2-J82RF_ksUE9Hps_iCCuNRJSnxWfHi_wo

To claim this, I am signing this object:

sealed abstract trait MetricStyle
trait Gauge extends MetricStyle
trait Metric extends MetricStyle with MetricValue
class IntGauge extends Metric with Gauge {
type Value =Int
}
object MetricOp {
@ant8e
ant8e / gist:5432942
Last active December 16, 2015 12:09
change target in assembly
import AssemblyKeys._
name := "Assemblytest"
version := "1.0.0"
scalaVersion := "2.10.1"