This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dmap | |
import scala.reflect.runtime.universe._ | |
import DMap._ | |
class DMap private(underlying: Map[Any, Entry]) { | |
def get[T](key: Any)(implicit tt: TypeTag[T]): Option[T] = { | |
underlying.get(key) match { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate edn; | |
extern crate ordered_float; | |
use edn::Value; | |
//use std::collections::hash_map::*; | |
use std::convert::From; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
style = IntelliJ | |
maxColumn = 120 | |
continuationIndent.callSite = 2 | |
continuationIndent.defnSite = 2 | |
align.openParenDefnSite = false | |
align.openParenCallSite = false | |
assumeStandardLibraryStripMargin = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait HashScheme[Out] { | |
def seedValue: Out | |
def combine(left: Out, right: Out): Out | |
trait Hash[-In] { | |
self => | |
def apply(in: In): Out = apply(seedValue, in) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 info it worked if it ends with ok | |
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build-debug' ] | |
2 info using npm@3.5.2 | |
3 info using node@v6.11.4 | |
4 verbose run-script [ 'prebuild-debug', 'build-debug', 'postbuild-debug' ] | |
5 info lifecycle @~prebuild-debug: @ | |
6 silly lifecycle @~prebuild-debug: no script for prebuild-debug, continuing | |
7 info lifecycle @~build-debug: @ | |
8 verbose lifecycle @~build-debug: unsafe-perm in lifecycle true | |
9 verbose lifecycle @~build-debug: PATH: /usr/share/npm/bin/node-gyp-bin:/home/josh/workspace/rust/wasm_game_of_life/node_modules/.bin:/home/josh/torch/install/bin:/home/josh/torch/install/bin:/home/josh/torch/install/bin:/home/josh/torch/install/bin:/home/josh/.cargo/bin:/home/josh/bin:/home/josh/.local/bin:/home/josh/torch/install/bin:/home/josh/torch/install/bin:/home/josh/torch/install/bin:/home/josh/torch/install/bin:/home/josh/.cargo/bin:/home/josh/bin:/home/josh/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sna |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.TimeUnit | |
import akka.actor.{Actor, ActorLogging, ActorRef, ActorSystem, PoisonPill, Props} | |
import akka.util.Timeout | |
import cats.Id | |
import scala.collection.immutable.Queue | |
import scala.concurrent.duration.FiniteDuration | |
import scala.concurrent.{ExecutionContext, Future} | |
import scala.language.higherKinds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.joshlemer.traitobjects | |
import java.io._ | |
import com.github.joshlemer.traitobjects.traitobjects.TObj | |
import scala.collection.mutable.ListBuffer | |
import scala.language.higherKinds | |
import scala.language.implicitConversions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TarArchive(tarArchiveInputStream: () => TarArchiveInputStream) extends Iterable[TarArchiveEntry] { self => | |
def iterator = new TarArchiveIterator(tarArchiveInputStream()) | |
def /(path: String): Iterable[TarArchiveEntry] = new Iterable[TarArchiveEntry] { | |
def iterator = self.iterator.filter(_.getName.startsWith(path)) | |
} | |
def iterableOf[T](implicit getFromTar: GetFromTar[T]): Iterable[T] = | |
new Iterable[T] { override def iterator = self.iterator.mapTo[T] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Lang { | |
def name: String | |
} | |
object Lang { | |
trait En extends Lang { def name = "en"} | |
implicit object En extends En | |
trait Fr extends Lang { def name = "fr"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Js { | |
sealed trait Val extends Any { | |
def value: Any | |
def apply(i: Int): Val = this.asInstanceOf[Arr].value(i) | |
def apply(s: java.lang.String): Val = | |
this.asInstanceOf[Obj].value.find(_._1 == s).get._2 | |
} | |
case class Str(value: java.lang.String) extends AnyVal with Val | |
case class Obj(value: (Val, Val)*) extends AnyVal with Val | |
case class Arr(value: Val*) extends AnyVal with Val |