This file contains hidden or 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 jdk.incubator.concurrent.StructuredTaskScope; | |
// java --enable-preview --source 19 --add-modules jdk.incubator.concurrent Loom.java | |
public class Loom { | |
public static void main(String[] args) { | |
run(); | |
} | |
public static void run() { |
This file contains hidden or 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.2.0 | |
//> using lib "org.scala-lang.modules::scala-xml:2.1.0" | |
import scala.xml.Elem | |
import java.io.File | |
import scala.xml.XML | |
import java.nio.file.Paths | |
import scala.util.Using | |
import java.nio.file.Files |
This file contains hidden or 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
<template> | |
<div class="map-box" id="maptest"></div> | |
</template> | |
<script> | |
import Vue from 'vue' | |
// If you need to reference 'L', such as in 'L.icon', then be sure to | |
// explicitly import 'leaflet' into your component | |
import L from 'leaflet' |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
---|---|---|---|---|---|---|---|---|---|