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
name := "sbt-scopes" | |
version := "0.1" | |
scalaVersion := "2.12.4" | |
lazy val Probe = config("probe").intransitive | |
.extend(Compile) | |
.describedAs("Probe configuration") |
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
copyProbeClasses := { | |
val log = streams.value.log | |
val probeTarget = new File(crossTarget.value, "probe-classes") | |
(probeTarget ** "*" filter(_.isFile)).get.foreach { fl => | |
log.info("Copying " + fl.relativeTo(probeTarget).get.toString) | |
Files.copy(fl.toPath, new File((classDirectory in Compile).value, fl.relativeTo(probeTarget).get.toString).toPath, REPLACE_EXISTING) | |
} | |
} |
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 scala.util.{Success, Try} | |
val pf1: PartialFunction[Try[String], String] = { | |
case Success(s) => s | |
} | |
val pf2: PartialFunction[String, String] = { | |
case s if s.contains("pass") => s | |
} |
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 coursierapi.MavenRepository | |
interp.repositories.update(interp.repositories() ::: List(MavenRepository.of( | |
"http://dl.bintray.com/danslapman/maven" | |
)) | |
@ | |
import $ivy.`danslapman::shapeless-circe:1.0` | |
import $plugin.$ivy.`org.spire-math::kind-projector:0.9.7` |
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
interp.configureCompiler(_.settings.YpartialUnification.value = true) |
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.time._ | |
import java.time.format.{DateTimeFormatter, DateTimeFormatterBuilder} | |
import java.time.temporal.{ChronoField, TemporalAccessor} | |
import java.{time => jt} | |
import scala.util.Try | |
trait ZonedParser { | |
protected val formatter: DateTimeFormatter |
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.nio.file.{Files, Paths, StandardOpenOption => SOO} | |
import scala.io.Source | |
import collection.JavaConverters._ | |
val sep = System.lineSeparator | |
val file = Source.fromFile(..) | |
val data = file.getLines | |
... |
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 requests | |
class ConsulClient: | |
def __init__(self, consul_host, consul_port=8500): | |
self._service_url_template = "http://{host}:{port}/v1/catalog/service/{name}" | |
self._host = consul_host | |
self._port = consul_port | |
def get_service(self, service_name): |
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
interp.configureCompiler(_.settings.YpartialUnification.value = true) |
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
interp.configureCompiler(_.settings.YpartialUnification.value = true) |