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
1/18 : Encode single Seq[Int] | |
============================= | |
Library ops/s % size % size.gz % | |
BooPickle 146324 8.4% 2 100% 32 100% | |
Prickle 231064 13.2% 27 1350% 58 181% | |
uPickle 245188 14.1% 3 150% 35 109% | |
Circe 962996 55.2% 3 150% 35 109% | |
Pushka 1744486 100.0% 3 150% 35 109% | |
2/18 : Decode single Seq[Int] |
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 ZipModelR[M, S, SS](root: ModelR[M, M], get1: M => S, get2: M => SS)(implicit cts: ClassTag[S], ctss: ClassTag[SS]) extends ModelR[M, (S, SS)] { | |
private var zipped = Tuple2[S, SS](null.asInstanceOf[S], null.asInstanceOf[SS]) | |
// ZipModel uses optimized `get` functions to compare if the contents of the tuple has changed or not | |
// Different comparison functions are used for boxed values and real references | |
private def getXX(compS: (S, S) => Boolean, compSS: (SS, SS) => Boolean)(model: M) = { | |
// check if inner references have changed | |
val v1 = get1(root.value) | |
val v2 = get2(root.value) | |
if (compS(zipped._1, v1) || compSS(zipped._2, v2)) { |
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
.room-list-item__unread-badge { | |
color: black; | |
} | |
pre code { | |
text-rendering: optimizeLegibility; | |
font-family: Hasklig, monospace; | |
} |
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 scala.tools.nsc.interactive, scala.tools.nsc.reporters._, scala.tools.nsc._ | |
object Test { | |
def main(args: Array[String]): Unit = { | |
val reporter = new StoreReporter | |
val s = new Settings() | |
s.processArgumentString("-Ypresentation-any-thread") | |
val global = new interactive.Global(s, reporter) | |
import global._ | |
val Cursor = ""//"_DUMMY_ " |
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
// $FiddleDependency org.scala-js %%% scalajs-dom % 0.9.0 | |
// $FiddleDependency com.lihaoyi %%% scalatags % 0.5.4 | |
import scalatags.JsDom.all._ | |
import org.scalajs.dom | |
import fiddle.Fiddle, Fiddle.println | |
import scalajs.js | |
object ScalaFiddle extends js.JSApp { | |
def main() = { | |
// $FiddleStart |
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
"Macau", | |
"Macedonia", | |
"Madagascar", | |
"Malawi", | |
"Malaysia", | |
"Maldives", | |
"Mali", | |
"Malta", | |
"Marshall Islands", | |
"Mauritania", |
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
// $FiddleDependency org.scala-js %%% scalajs-dom % 0.9.0 | |
// $FiddleDependency com.lihaoyi %%% scalatags % 0.5.4 | |
import scalatags.JsDom.all._ | |
import org.scalajs.dom | |
import fiddle.Fiddle, Fiddle.println | |
import scalajs.js | |
object ScalaFiddle extends js.JSApp { | |
def main() = { | |
// $FiddleStart |
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 japgolly.scalajs.react._ | |
import org.scalajs.dom | |
import org.scalajs.dom.raw.{HTMLElement, MouseEvent} | |
object Dropdown { | |
import japgolly.scalajs.react.vdom.all._ | |
case class State(isOpen: Boolean = false) | |
case class Props(classes: String, content: ReactNode) |
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 fiddle.Fiddle, Fiddle.println | |
import scalajs.js | |
import scalacss.Defaults._ | |
@js.annotation.JSExport | |
object ScalaFiddle { | |
println( MyStyles.render ) | |
} | |
object MyStyles extends StyleSheet.Inline { |
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 CassandraWrapper { | |
import scala.language.implicitConversions | |
import scala.language.postfixOps | |
/** | |
* Converts a `ResultSetFuture` into a Scala `Future[ResultSet]` | |
* @param f ResultSetFuture to convert | |
* @return Converted Future | |
*/ | |
implicit def resultSetFutureToScala(f: ResultSetFuture): Future[ResultSet] = { | |
val p = Promise[ResultSet]() |
OlderNewer