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
#!/usr/bin/env -S scala-cli shebang --scala-version 3.1.2 | |
/* | |
Proof of concept to convert iFDO YAML to FathomNet CSV | |
Requirements: | |
- Install scala-cli https://scala-cli.virtuslab.org | |
Usage: | |
ifdo-to-fathomnet.sc <ifdo-yaml-file> > <fathomnet-csv-file> |
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.lang.System.Logger | |
import java.lang.System.Logger.Level | |
import java.util.function.Supplier | |
/** | |
* * @author Brian Schlining | |
*/ | |
object Logging: | |
case class LoggerBuilder( |
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
#!/usr/bin/env bash | |
echo "--- Building vars-kb-server (reminder: run docker login first!!)" | |
VCS_REF=`git tag | sort -V | tail -1` | |
docker buildx build --platform linux/amd64,linux/arm64 \ | |
-t mbari/vars-kb-server:${VCS_REF} \ | |
-t mbari/vars-kb-server:latest \ | |
--push . \ |
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.lang.System.Logger | |
import java.lang.System.Logger.Level | |
object Logging: | |
private def logAndReturn[T](obj: T, logger: Logger, level: Level, fn: T => String): T = | |
if logger.isLoggable(level) then | |
logger.log(level, fn(obj)) | |
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
import java.net.URL | |
import scala.deriving.* | |
import scala.compiletime.{summonAll} | |
import java.nio.file.Path | |
/** | |
* Base function we use to convert case classes to CSV | |
* @param a The object to convert | |
*/ | |
def transform[A : Transformer](a: A) = summon[Transformer[A]].f(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
#!/usr/bin/env scala | |
/* | |
@author Brian Schlining | |
@since 2021-10-25 | |
Scala version of example code at | |
https://python.plainenglish.io/send-http-requests-as-fast-as-possible-in-python-304134d46604 | |
*/ |
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
Metric | Cask | Helidon | http4s | Javalin | Scalatra | Spark Java | Vert.x Web | ZIO Http | |
---|---|---|---|---|---|---|---|---|---|