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 service.model | |
import scala.collection.mutable.BitSet | |
import scala.util.hashing.MurmurHash3 | |
import zio.* | |
case class HashResult(base: Long, seed: Int) | |
/** Represents a slot in the bloom filter | |
* |
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 zio.* | |
import zio.Executor | |
import zio.Console.printLine | |
object CustomizedRuntimeZIOApp extends ZIOAppDefault: | |
val blockingTask = (n: Int) => | |
for { | |
_ <- printLine(s"start potentially long API call or something for $n") | |
r <- Random.nextIntBetween(500, 1000) | |
_ <- ZIO.succeed(Thread.sleep(r)) |
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 zio.* | |
import zio.Executor | |
import java.util.concurrent.atomic.AtomicInteger | |
import java.util.concurrent._ | |
object CustomizedRuntimeZIOApp extends ZIOAppDefault { | |
class NamedThreadFactory(name: String, daemon: Boolean) | |
extends ThreadFactory { | |
private val parentGroup = Thread.currentThread.getThreadGroup |
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 todo | |
import com.github.ahnfelt.react4s._ | |
import org.scalajs.dom.window | |
import todo.TodoCircuit._ | |
import scala.scalajs.js.annotation._ | |
@JSExportTopLevel("TodoApp") | |
object TodoApp { |
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 advent | |
class Advent19 extends Advent { | |
type Grid = Array[Array[Char]] | |
case class Position(x: Int, y: Int) | |
sealed trait Move { | |
def apply(position: Position): Position | |
} | |
case object Up extends Move { | |
def apply(p: Position): Position = p.copy(y = p.y - 1) |
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 akka.NotUsed | |
import akka.actor.ActorSystem | |
import akka.stream._ | |
import akka.stream.scaladsl._ | |
import scala.concurrent.Future | |
import scala.concurrent.duration._ | |
object Example extends App { | |
implicit val system = ActorSystem("QuickStart") |