機能\サービス | Travis CI | Circle CI | Shippable | Wercker | BuildHive |
---|---|---|---|---|---|
Private Repo | 有料 | 無料 | 無料 | 無料 | |
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.util.concurrent.atomic.AtomicInteger | |
import java.util.concurrent.{ ThreadFactory, Executors, ExecutorService } | |
import scalaz.concurrent.Task | |
object Test { | |
class MyThreadFactory(prefix: String) extends ThreadFactory { | |
val n = new AtomicInteger(0) | |
override def newThread(r: Runnable) = { | |
val t = Executors.defaultThreadFactory().newThread(r) |
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.charset.Charset | |
import java.text.SimpleDateFormat | |
import java.util.Date | |
import com.amazonaws.services.elasticbeanstalk.AWSElasticBeanstalkClient | |
import com.amazonaws.services.elasticbeanstalk.model.{UpdateEnvironmentRequest, S3Location, CreateApplicationVersionRequest} | |
import com.amazonaws.services.s3.AmazonS3Client | |
import com.amazonaws.services.s3.model.Region | |
import com.typesafe.sbt.packager.docker.DockerPlugin | |
import com.typesafe.sbt.packager.docker.DockerPlugin.autoImport.{Docker, dockerExposedPorts} |
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
case class A(i: Int) | |
case class B(i: Int) | |
case class C(i: Int) | |
class ImplicitTest { | |
object Implicits { | |
implicit val ia = A(1) | |
} | |
implicit def a2b(implicit a: A): B = new B(a.i) |
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
implicit def longMapWrites[V](implicit fmtv: Writes[V]): OWrites[collection.immutable.Map[Long, V]] = OWrites[collection.immutable.Map[Long, V]] { ts => | |
JsObject(ts.map { case (k, v) => (k.toString, Json.toJson(v)(fmtv)) }.toList) | |
} |
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 scalaz.Free.FreeC | |
import scalaz.{Free, ~>} | |
import scalaz.std.function._ | |
sealed trait Console[A] | |
case object ReadLine extends Console[Option[String]] | |
case class PrintLn(s: String) extends Console[Unit] | |
object Console { | |
type ConsoleIO[A] = FreeC[Console, 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
yv66vgADAC0AEwwAEAASAQAWKFtMamF2YS9sYW5nL1N0cmluZzspVgEADEhlbGxvIFdvcmxkIQcACwgAAwcADgEABENvZGUBAARtYWluCQAGAAEMAAwAEQEAE2phdmEvaW8vUHJpbnRTdHJlYW0BAAdwcmludGxuBwAHAQAQamF2YS9sYW5nL1N5c3RlbQoABAAKAQADb3V0AQAVKExqYXZhL2xhbmcvU3RyaW5nOylWAQAVTGphdmEvaW8vUHJpbnRTdHJlYW07ACEADQAEAAAAAAABAAkACAACAAEABwAAABUAAgABAAAACbIACRIFtgAPsQAAAAAAAA== |
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
行間の見えない依存は少ないほうが良い。 | |
1: var a = f() | |
2: var b = g() | |
3: var c = h() | |
f(), g(), h() が副作用を含むとすれば、行間に依存関係がある可能性がある。例えば g() は f() を読んだあとでないと動かないなどの例があげられる。ファイルの open(), close() などを思い浮かべると、依存関係(open() してからでないと close() できない)が想像しやすい。 | |
行数で言えば 1 -> 2, 1 -> 3, 2 -> 3 の依存を疑わなければならない。行を入れ替えると挙動が変わるおそれがある。 | |
上の例で、f(),g(),h()が副作用を含まないとすれば、行間の依存はない。 |
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
> update | |
[info] Updating {file:/Users/kawachi/tmp/hohoho/}hohoho... | |
[info] Resolving com.github.tkawachi#testproj;v0.0.1 ... | |
[warn] problem while downloading module descriptor: https://jitpack.io/com/github/tkawachi/testproj/v0.0.1/testproj-v0.0.1.pom: The HTTP response code for https://jitpack.io/com/github/tkawachi/testproj/v0.0.1/testproj-v0.0.1.pom did not indicate a success. See log for more detail. (5ms) | |
[warn] module not found: com.github.tkawachi#testproj;v0.0.1 | |
[warn] ==== local: tried | |
[warn] /Users/kawachi/.ivy2/local/com.github.tkawachi/testproj/v0.0.1/ivys/ivy.xml | |
[warn] ==== public: tried | |
[warn] https://repo1.maven.org/maven2/com/github/tkawachi/testproj/v0.0.1/testproj-v0.0.1.pom | |
[warn] ==== jitpack.io: tried |
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 com.github.kxbmap.configs._ | |
import com.typesafe.config.Config | |
object ConfigAny { | |
implicit class ConfigAnyImplicit(val config: Config) { | |
def optAny[A: AtPath](keys: Seq[String])(implicit cc: CatchCond = CatchCond.missing): Option[A] = | |
keys.foldLeft(None: Option[A]) { (a, e) => a.orElse(config.opt[A](e)) } | |
def getAny[A: AtPath](keys: Seq[String])(implicit cc: CatchCond = CatchCond.missing): A = | |
optAny(keys).getOrElse(sys.error(s"Any of $keys are not specified.")) |