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
// libraryDependencies += "com.github.alexarchambault" %% "scalacheck-shapeless_1.14" % "1.2.0" | |
// libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.14.0" | |
// libraryDependencies += "com.thesamet.scalapb" %% "scalapb-runtime" % "0.8.4" | |
import org.scalacheck.{ Arbitrary, Gen, ScalacheckShapeless } | |
import scalapb.{ GeneratedEnum, GeneratedEnumCompanion, TypeMapper } | |
/** | |
* Derives `or.scalacheck.Arbitrary` for generated by `scalapb` classes. | |
* |
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.atomic.{ AtomicBoolean, AtomicReference } | |
import scala.concurrent.ExecutionContext | |
class Node[A](var a: A = null.asInstanceOf[A]) extends AtomicReference[Node[A]] { | |
def next: Node[A] = get() | |
def next_=(n: Node[A]): Unit = lazySet(n) | |
} | |
class MPSCQueue[A] { |
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
<code_scheme name="Dokwork Scala Style"> | |
<option name="OTHER_INDENT_OPTIONS"> | |
<value> | |
<option name="INDENT_SIZE" value="2" /> | |
<option name="CONTINUATION_INDENT_SIZE" value="8" /> | |
<option name="TAB_SIZE" value="2" /> | |
<option name="USE_TAB_CHARACTER" value="false" /> | |
<option name="SMART_TABS" value="false" /> | |
<option name="LABEL_INDENT_SIZE" value="0" /> | |
<option name="LABEL_INDENT_ABSOLUTE" value="false" /> |
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 org.json4s.JsonAST.JObject | |
import org.json4s.native.JsonMethods._ | |
import org.json4s.native.Serialization.write | |
import org.json4s.{ DefaultFormats, Diff, Formats, JValue } | |
import org.scalatest.matchers._ | |
import org.scalatest.{ FreeSpec, Matchers } | |
object Json { | |
def apply(right: String)(implicit formats: Formats): BeMatcher[String] = |
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
function encode64(data) { | |
r = ""; | |
for (i=0; i<data.length; i+=3) { | |
if (i+2==data.length) { | |
r +=append3bytes(data.charCodeAt(i), data.charCodeAt(i+1), 0); | |
} else if (i+1==data.length) { | |
r += append3bytes(data.charCodeAt(i), 0, 0); | |
} else { | |
r += append3bytes(data.charCodeAt(i), data.charCodeAt(i+1), data.charCodeAt(i+2)); | |
} |