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
file Lines Tokens Tasty Complexity/Line Directory | |
[info] package.scala 3 31 8 2.67 moderate /Users/velvetbaldmime/projects/indoorvivants/smithy4s-aws-only/src/main/scala/generated/hello | |
[info] InferenceUnitsInteger.scala 13 112 11 0.85 low /Users/velvetbaldmime/projects/indoorvivants/smithy4s-aws-only/src/main/scala/generated/com/amazonaws/comprehend | |
[info] NumberOfDocuments.scala 13 112 11 0.85 low /Users/velvetbaldmime/projects/indoorvivants/smithy4s-aws-only/src/main/scala/generated/com/amazonaws/comprehend | |
[info] EntityTypeName.scala 13 112 11 0.85 low /Users/velvetbaldmime/projects/indoorvivants/smithy4s-aws-only/src/main/scala/generated/com/amazonaws/comprehend | |
[info] AnyLengthString.scala 13 112 11 |
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 scala 3.4.0 | |
package bla | |
import scala.deriving.*, scala.compiletime.* | |
// change this to FASTER to go brrr | |
import EVEN_FASTER_SOMETIMES.* | |
// MAGIC |
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 myLazyWork(str: String) = | |
str match | |
case "hello" => println("yo") | |
case "world" => TODO("world is unhandled") | |
@main def hello = | |
myLazyWork("hello") | |
myLazyWork("world") | |
Byte pair encoding tokenizer ported almost verbatim from Python code by Andrej Karpathy: https://github.com/karpathy/minbpe/blob/master/minbpe/basic.py
Inspired by the video on Andrej's Youtube channel
It's a Scala CLI project, so you can easily run it with scala-cli run bpe.scala -- shakespeare.small.txt
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 godot | |
import _root_.scala.scalanative.unsafe.* | |
import _root_.scala.scalanative.unsigned.* | |
import _root_.scala.scalanative.libc.* | |
import _root_.scala.scalanative.* | |
object predef: | |
private[godot] trait CEnumU[T](using eq: T =:= UInt): | |
given Tag[T] = Tag.UInt.asInstanceOf[Tag[T]] |
Run with Scala CLI (https://scala-cli.virtuslab.org/):
scala-cli run .
And then go to http://localhost:9991
Happy coding, Scala is great.
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.http4s::http4s-scalatags::0.25.2" | |
//> using dep "org.http4s::http4s-dsl::0.23.23" | |
//> using dep "org.http4s::http4s-ember-server::0.23.23" | |
//> using dep "org.tpolecat::skunk-core::0.6.0" | |
//> using dep "com.dimafeng::testcontainers-scala-postgresql::0.41.0" | |
//> using dep "com.outr::scribe-slf4j::3.12.2" | |
import skunk.*, codec.all.*, syntax.all.* | |
import cats.effect.* | |
import scalatags.Text.all.* |
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.http4s::http4s-ember-server::0.23.23 | |
//> using dep org.http4s::http4s-dsl::0.23.23 | |
//> using dep com.outr::scribe-cats::3.11.8 | |
/** This script implements a file proxy, which puts basic auth username and | |
* password challenge, in order to simulate password-protected artifactory | |
* | |
* To run it, use Scala CLI: https://scala-cli.virtuslab.org/ | |
* | |
* Run `scala-cli run test.scala` and follow instructions |
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 libtest | |
import _root_.scala.scalanative.unsafe.* | |
import _root_.scala.scalanative.unsigned.* | |
import _root_.scala.scalanative.libc.* | |
import _root_.scala.scalanative.* | |
object predef: | |
private[libtest] trait CEnumU[T](using eq: T =:= UInt): | |
given Tag[T] = Tag.UInt.asInstanceOf[Tag[T]] |
NewerOlder