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 activation.service.instances.amazon | |
import cats.effect.{IO, IOApp, Resource, Sync} | |
import com.nimbusds.jose.util.X509CertUtils | |
import cats.syntax.all.* | |
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo | |
import org.bouncycastle.jce.provider.BouncyCastleProvider | |
import org.bouncycastle.openssl.{PEMParser, PEMKeyPair} | |
import java.security.Signature |
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.collection.immutable.HashMap | |
object Demo extends App { | |
sealed trait Input | |
object Input{ | |
final case class IncrementCounter(humanIndex: Int) extends Input | |
case object MaxCounter extends Input | |
def fromInt(n: Int, arraySize: Int): Input = if (n <= arraySize){ |
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
{ | |
"info": { | |
"_postman_id": "3673316a-9a35-4b0d-a148-3566b490798d", | |
"name": "Hello World", | |
"description": "A simple collection with one request that has tests to validate response. You can use this collection as a entry-levle example to demonstrate Postman's debugging capabilities.", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Hello World", |
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
private def extractNestedArray( | |
json: Json | |
): Option[(NonEmptyList[String], Vector[Json])] = { | |
def extractNestedArrayInternal( | |
acum: List[String], | |
json: Json | |
): Option[(NonEmptyList[String], Vector[Json])] = | |
json.arrayOrObject( | |
or = None, |
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 cats.data.NonEmptyList | |
import io.circe.{ACursor, Json, JsonObject} | |
import cats.instances.option._ | |
object Foo { | |
def flattenJson(input: Json): Json = { | |
var result: Json = Json.obj() |
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 Foo extends App { | |
import cats.data.Kleisli | |
import cats.Functor | |
import cats.effect.IO | |
import cats.syntax.functor._ | |
import cats.syntax.flatMap._ | |
type TraceyId = String | |
type Tracey[F[_], A] = Kleisli[F, TraceyId, A] | |
type TraceyIO[A] = Tracey[IO, 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
import cats.{Applicative, Functor} | |
import cats.effect.concurrent.Ref | |
import cats.effect.{Concurrent, ExitCode, IO, IOApp, Timer} | |
import fs2.Stream | |
import cats.syntax.functor._ | |
import cats.syntax.applicative._ | |
import scala.concurrent.duration.DurationInt | |
object DemoApp extends IOApp { |
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.PrintWriter | |
import cats.effect.{ExitCode, IO, IOApp, Resource, Sync} | |
import cats.syntax.traverse._ | |
import cats.syntax.functor._ | |
import scala.io.Source | |
object IdDiff extends IOApp { |
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 cats.data.NonEmptyList | |
object Snail { | |
case class Coordinate(i: Int, j: Int) | |
case class Navigation(visitedSofar: NonEmptyList[Coordinate]) | |
sealed trait Direction | |
object Direction { | |
case object Up extends Direction |
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 Config(barConfig: Config.BarConfig, fooConfig: Config.FooConfig) | |
object Config { | |
trait BarConfig | |
trait FooConfig | |
} | |
/* Client layer */ | |
import cats.data.ReaderT | |
import Config._ |
NewerOlder