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 smithy4s.ShapeId | |
import smithy4s.Bijection | |
import smithy4s.Hints | |
import smithy4s.Newtype | |
import smithy4s.Schema | |
import smithy4s.schema.Schema.bijection | |
import smithy4s.schema.Schema.string | |
import io.github.arainko.ducktape.* | |
import monix.newtypes.* | |
import scala.Either |
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
### Keybase proof | |
I hereby claim: | |
* I am kareblak on github. | |
* I am kareblak (https://keybase.io/kareblak) on keybase. | |
* I have a public key whose fingerprint is CF12 2596 B9CE F2FF AA37 3727 6CDA 282B 269B 1FA1 | |
To claim this, I am signing this object: |
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
sealed trait T | |
object T { | |
object X { | |
case class T1(foo: String) | |
case class T2(bar: 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
def lastB[A, B](implicit S:Strategy): Pipe2[Task, A, B, (A, B)] = (as, bs) => | |
bs.uncons1.flatMap { | |
case None => Stream.empty | |
case Some((init, newBs)) => | |
as.either(newBs).mapAccumulate(init) { | |
case (b, Left(a)) => (b, Some(a)) | |
case (_, Right(b)) => (b, None) | |
}.collect { case (b, Some(a)) => (a, b) } | |
} |
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 fs2._ | |
import org.http4s._ | |
import org.http4s.dsl._ | |
import org.http4s.server.blaze._ | |
import org.http4s.server.websocket._ | |
import org.http4s.util._ | |
import org.http4s.websocket.WebsocketBits | |
import scala.concurrent.duration._ | |
import fs2.async.mutable.Topic |
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
{ | |
"vessel_id": "259994000", | |
"vessel_name": "REBBENESOY", | |
"for_day": "2017-02-12", | |
"connections": [ | |
{ | |
"name": "188", | |
"total_time_in_traffic": { | |
"value": 5.130917777777778, | |
"unit": "hours" |
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
def mappedIntent = Mapping[Any, String] { | |
case ContextPath(_, path) => path | |
} | |
def intent = mappedIntent { | |
case "/" => (get | post) | |
} | |
Error:(23, 22) type mismatch; | |
found : unfiltered.directives.FilterDirective[javax.servlet.http.HttpServletRequest,Any,unfiltered.response.ResponseFunction[Any]] |
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
case class GetOrElseCachedValue[K, V](key: K, orElse: () => V) | |
case class GetCachedValue[K, V](key: K) | |
case class PutCachedValue[K, V](key: K, value: V) | |
case class ReturnCachedValue[V](value: Option[V]) | |
case class RemoveCachedValue[K](key: K) | |
case object PurgeCachedValues | |
class CacheActor[K, V] private[cache](cache: Cache) extends Actor with ActorLogging with StatsD { | |
type FV = (() => V) |
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.io.FileOutputStream | |
Console.withOut(new FileOutputStream("/Users/kareblak/Downloads/area.sql")) { | |
println( | |
scala.io.Source.fromFile("/Users/kareblak/Downloads/areas.csv").getLines.toList.tail.map(_.split(',')).groupBy { | |
case Array(_, n, _*) => n | |
}.map { | |
case (k, vs) => k -> vs.collect { | |
case Array(_, _, _, c) => c | |
} |
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
useGpg := true | |
appAssemblerSettings | |
appOutput in App := target.value / "appmgr" / "root" | |
appmgrSettings | |
appmgrOutputFile in Appmgr := target.value / "%s-appmgr.zip".format(name.value) |
NewerOlder