I hereby claim:
- I am kevinwright on github.
- I am thecoda (https://keybase.io/thecoda) on keybase.
- I have a public key whose fingerprint is 7B0A E482 1479 D389 A452 49B7 EF27 0EC3 7CC6 9FE9
To claim this, I am signing this object:
import shapeless._ | |
trait Thingy[T] { def stringy(t:T): String } | |
implicit def autoThingy[T <: Product](implicit gen: LabelledGeneric[T]) : Thingy[T] = new Thingy[T] { | |
def toRecord[T <: Product, Repr](obj: T)(implicit lg: LabelledGeneric.Aux[T, Repr]): Repr = lg.to(obj) | |
def stringy(t: T) = { | |
val rec = toRecord(t) | |
val keys = rec.keys | |
keys.mkString |
import shapeless._ | |
case class Wibble(x: Int, y: String) | |
val wib = Wibble(42, "towel") | |
def recOf[T](obj: T)(implicit gen: LabelledGeneric[T]) = gen.to(obj) | |
recOf(wib) // works beautifully | |
class ClassyRecOf[T](implicit gen: LabelledGeneric[T]) { | |
def doIt(obj: T) = gen.to(obj) |
import akka.actor._ | |
import scala.collection.mutable | |
case class DeferredActorRef(implicit factory: ActorRefFactory) { | |
private[this] val innerActor = factory.actorOf(Props(new TheActor)) | |
private[this] case class SetRef(ref: ActorRef) | |
private[this] class TheActor extends Actor with ActorLogging { | |
val buffer: mutable.Queue[(Any, ActorRef)] = mutable.Queue.empty |
I hereby claim:
To claim this, I am signing this object:
java.lang.NullPointerException | |
at scala.reflect.internal.Scopes$Scope.unlink(Scopes.scala:202) | |
at scala.reflect.internal.Scopes$Scope.unlink(Scopes.scala:222) | |
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter$$anonfun$destroy$1.apply(Namers.scala:301) | |
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter$$anonfun$destroy$1.apply(Namers.scala:299) | |
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) | |
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:35) | |
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.destroy(Namers.scala:299) | |
at org.scalamacros.paradise.typechecker.Namers$Namer$$anon$2.maybeExpand(Namers.scala:393) | |
at org.scalamacros.paradise.typechecker.Namers$Namer$MaybeExpandeeCompleter.completeImpl(Namers.scala:320) |
As compiled by Kevin Wright a.k.a @thecoda
(executive producer of the movie, and I didn't even know it... clever huh?)
please, please, please - If you know of any slides/code/whatever not on here, then ping me on twitter or comment this Gist!
This gist will be updated as and when I find new information. So it's probably best not to fork it, or you'll miss the updates!
Monday June 16th
#!/bin/bash | |
if [ $# -lt 2 ]; then | |
echo "format: git_cleanup <repo name> [-x/--expunge <directory 1> -l/--keeplatest <directory 2> ...]" | |
exit | |
fi | |
PROJ="$1" | |
shift |
#!/bin/bash | |
set -f | |
SUBBED=($(sed -e "s,multiply,*,g" -e "s,divide,/,g" -e "s,add,+,g" -e "s,subtract,-,g" -e "s,apply,,g" -e "s, *,,g" $1)) | |
EXPR="" | |
for (( idx=${#SUBBED[@]}-1 ; idx>=0 ; idx-- )) ; do EXPR="($EXPR ${SUBBED[idx]})"; done | |
echo $(($EXPR)) |
#!/bin/bash | |
#disable globbing of the * | |
set -f | |
INPUT=$1 | |
SUBBED=($( | |
sed \ | |
-e "s,multiply,*,g" \ |
trait Proletariat { | |
type BigNumberT | |
def retirementAge: BigNumberT | |
val bippy = "hi mum" | |
def twiddle = 42 | |
def twaddle = 1 | |
} | |
trait BiggerTwaddle { |