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 ControllerHttp4sEndpoints { | |
def routes(controller: Controller[F])( | |
implicit ... | |
): HttpRoutes[F] = { | |
val endpoints = ControllerEndpoints.create() | |
val getContainers = | |
endpoints.getSomething.toRoutes((controller.getSomething _).tupled) | |
val getContainerStatus = endpoints.doSomething.toRoutes(controller.doSomething) | |
) | |
NonEmptyList( |
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 ControllerEndpoints { | |
def create(statusCodes: String => Int = _ => 422)( | |
implicit stringJsonCodec: JsonCodec[String], | |
listJsonCodec: JsonCodec[Result], | |
) = new DockerMonitorControllerFEndpoints { | |
override val getSomething | |
: Endpoint[String, GenericError, Result, Nothing] = | |
endpoint.get | |
.in("getContainers") |
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.StaticAnnotation | |
class query extends StaticAnnotation | |
class command extends StaticAnnotation | |
import io.circe.generic.JsonCodec | |
@JsonCodec case class GenericError( | |
message: String = "", | |
code: Int = 500 | |
) |
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
lazy val dockerMonitor = project | |
.settings(libraryDependencies ++= dependencies) | |
.settings( | |
tapiro / tapiroRoutesPath := "relative path to the routes", | |
tapiro / tapiroModelsPath := "relative path to the models", | |
tapiro / tapiroOutputPath := "relative path for the generated models", | |
tapiro / tapiroEndpointsPackage := cats.data.NonEmptyList("dockerMonitor", Nil), | |
) | |
.enablePlugins(SbtTapiro) | |
.dependsOn(authContracts) |
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 intervals | |
import scala.language.implicitConversions | |
import cats.Monoid | |
import cats.syntax.foldable._ | |
import cats.instances.list._ | |
import scala.math.Ordering | |
object Main extends App { | |
import Interval._ |
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
echo “very spoofy” | mail -s “much boring” [email protected] |
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 midi #pip install python-midi (https://github.com/vishnubob/python-midi) | |
pattern = midi.Pattern() | |
track = midi.Track() | |
pattern.append(track) | |
on = midi.NoteOnEvent(tick=0, velocity=100, pitch=60) | |
track.append(on) | |
off = midi.NoteOffEvent(tick=100, pitch=60) | |
track.append(off) | |
eot = midi.EndOfTrackEvent(tick=1) |
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
alias sbt='f() { sbt "$@" |tee -a ~/.sbtlogs; };f' |
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 shapeless._ | |
sealed trait A | |
case object A1 extends A | |
case object A2 extends A | |
case object A3 extends A | |
case class B( | |
A1: String, | |
A2: String, | |
A3: 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
containers: | |
env: | |
image: davidshen84/scikit-learn | |
run: | |
publish: | |
- 8888:8888 | |
interactive: true | |
tty: true | |
volume: ["./data:/data", "./notebook:/notebook"] |
NewerOlder