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
Please note that these warnings are just used to help the Homebrew maintainers | |
with debugging if you file an issue. If everything you use Homebrew for is | |
working fine: please don't worry or file an issue; just ignore this. Thanks! | |
Warning: Homebrew's sbin was not found in your PATH but you have installed | |
formulae that put executables in /usr/local/sbin. | |
Consider setting the PATH for example like so | |
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile | |
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
def coalesce[T] = quote { column: Option[T] => default: T => | |
infix"coalesce($column, $default)".as[T] | |
} |
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 $ivy.`io.getquill::quill:2.6.0` | |
import io.getquill._ | |
val ctx = new SqlMirrorContext(MirrorSqlDialect, Literal) | |
import ctx._ | |
case class Entity(field1: String, field2: Int) | |
def getEntity(field1: Option[String], field2: Option[Int]) = { |
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 $ivy.`org.typelevel::cats-core:1.4.0` | |
import $ivy.`org.typelevel::kittens:1.1.1` | |
import cats._ | |
import cats.data.{Validated, ValidatedNel} | |
//import cats.instances.list._ | |
import cats.sequence._ | |
import shapeless._ | |
import shapeless.labelled._ | |
import shapeless.record._ |
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 $ivy.`com.chuusai::shapeless:2.3.3` | |
import shapeless._ | |
trait Fields[T] { | |
def fields: List[String] | |
override def toString: String = fields.mkString(", ") | |
} | |
object Fields extends LabelledProductTypeClassCompanion[Fields] { | |
def apply[T](fs: List[String]): Fields[T] = new Fields[T] { | |
override def fields: List[String] = fs |
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.reflect.runtime.universe._ | |
type ¬[A] = A => Nothing | |
type ∨[T, U] = ¬[¬[T] with ¬[U]] | |
type ¬¬[A] = ¬[¬[A]] | |
type |∨|[T, U] = { type λ[X] = ¬¬[X] <:< (T ∨ U) } | |
val intpf: PartialFunction[Int, Int] = { case i: Int => i } | |
val strpf: PartialFunction[String, String] = { case str: String => str } |
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) |
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
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 | |
... |