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 example | |
private object lib { | |
def doStuff = println("Hello from MyLib") | |
} |
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.annotation.tailrec | |
object SelectionSort { | |
@tailrec | |
def sort(arr: List[Int], acc: List[Int] = Nil): List[Int] = { | |
if (arr.isEmpty) acc.reverse | |
else { | |
val min = arr.min | |
val (left, right) = arr.span(_ != min) |
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 os | |
import json | |
import argparse | |
from typing import Dict, Any, List | |
def convert_atproto_type_to_smithy(atproto_type: str, nested: bool = False) -> str: | |
""" | |
Convert ATP types to Smithy types with more robust type mapping | |
""" | |
type_mapping = { |
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.Show | |
import cats.syntax.all.* | |
trait Encoder[A] { | |
def encode(v: A): String | |
} | |
object Encoder extends EncoderDerivation { | |
object instances { |
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
//> using dep "org.typelevel::cats-effect:3.5.4" | |
//> using scala "3.3.3" | |
import cats.Functor | |
import cats.effect.std.UUIDGen | |
import cats.syntax.all.* | |
import java.util.UUID | |
final class MyId private (val id: 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
//> using dep "com.disneystreaming::weaver-cats:0.8.4" | |
//> using dep "com.lihaoyi::os-lib:0.10.7" | |
import weaver.* | |
import os.Path | |
object ExampleSuite extends FunSuite { | |
test("os-lib test") { | |
val path: os.Path = ??? |
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
runner.dialect = scala3 | |
runner.dialectOverride.allowSignificantIndentation = false | |
# allows `if x then y` | |
runner.dialectOverride.allowQuietSyntax = true | |
fileOverride { | |
"glob:**/*.sbt" { | |
runner.dialect = scala213 | |
# disable `if x then y` as it uses scala 2 syntax | |
runner.dialectOverride.allowQuietSyntax = 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
//> using dep "org.scalacheck::scalacheck:1.18.0" | |
import org.scalacheck.rng.Seed | |
@main | |
def main(base64Seed: String) = { | |
val seed: Seed = | |
Seed | |
.fromBase64(base64Seed) | |
.toOption | |
.get |
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
//> using dep "com.datadoghq:dd-trace-api:1.34.0" | |
//> using dep "org.typelevel::cats-effect:3.5.4" | |
import datadog.trace.api.civisibility.* | |
import cats.effect.* | |
object HelloIOApp extends IOApp.Simple { | |
val run = IO.delay { | |
println("Hello!") |
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
//> using dep "com.squareup.okhttp3:okhttp:4.12.0" | |
//> using dep "com.datadoghq:dd-trace-api:1.34.0" | |
import okhttp3.* | |
import datadog.trace.api.civisibility.* | |
object HelloApp extends App { | |
println("Hello!") | |
val testSession = | |
CIVisibility.startSession("my-project-name", "my-test-framework", null) |
NewerOlder