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
$ git rebase -i 【間違えたコミットのひとつ前のコミット】 |
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 org.nomadblacky.oreoretemplate | |
import xsbti.{ AppConfiguration, MainResult } | |
import scala.reflect.io.File | |
/** | |
* Created by blacky on 17/05/02. | |
*/ | |
case class Config(variablesFile: File = File("variables"), templateDirectory: File = File("templates")) |
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
scala> Some("a").map(_ == "a").getOrElse(false) | |
res5: Boolean = true | |
scala> Some("a").exists(_ == "a") | |
res6: Boolean = true | |
scala> Some("a").contains("a") | |
res7: Boolean = true |
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
scala> val a = doc >> elements("rect") >> attrs("data-date") | |
a: Iterable[String] = List(2016-06-05, 2016-06-06, 2016-06-07, 2016-06-08, 2016-06-09, 2016-06-10, 2016-06-11, 2016-06-12, 2016-06-13, 2016-06-14, 2016-06-15, 2016-06-16, 2016-06-17, 2016-06-18, 2016-06-19, 2016-06-20, 2016-06-21, 2016-06-22, 2016-06-23, 2016-06-24, 2016-06-25, 2016-06-26, 2016-06-27, 2016-06-28, 2016-06-29, 2016-06-30, 2016-07-01, 2016-07-02, 2016-07-03, 2016-07-04, 2016-07-05, 2016-07-06, 2016-07-07, 2016-07-08, 2016-07-09, 2016-07-10, 2016-07-11, 2016-07-12, 2016-07-13, 2016-07-14, 2016-07-15, 2016-07-16, 2016-07-17, 2016-07-18, 2016-07-19, 2016-07-20, 2016-07-21, 2016-07-22, 2016-07-23, 2016-07-24, 2016-07-25, 2016-07-26, 2016-07-27, 2016-07-28, 2016-07-29, 2016-07-30, 2016-07-31, 2016-08-01, 2016-08-02, 2016-08-03, 2016-08-04, 2016-08-05, ... | |
scala> a.filter(_ == "2017-06-01") | |
res1: Iterable[String] = List(2017-06-01) | |
scala> doc >> elements("rect") >/~ validator(attr("data-date"))(_ == "2017-06-01") | |
res2: Either[Unit,net.ruip |
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
@ def foo[T: scala.reflect.ClassTag](obj: Any): Unit = obj match { | |
case t: T => println(t.getClass.getName) | |
case _ => println("ng") | |
} | |
defined function foo | |
@ foo[Int](1) | |
java.lang.Integer | |
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
@ val options = List(None, None, Some(1), None, Some(2)) | |
options: List[Option[Int]] = List(None, None, Some(1), None, Some(2)) | |
@ options.collectFirst { | |
case Some(v) => v | |
} | |
res4: Option[Int] = Some(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
buildscript { | |
repositories { | |
jcenter() | |
} | |
dependencies { | |
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | |
} | |
} |
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 akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import com.typesafe.scalalogging.StrictLogging | |
import net.logstash.logback.marker.Markers | |
import org.slf4j.Marker | |
import play.api.libs.ws.StandaloneWSResponse | |
import play.api.libs.ws.ahc.{StandaloneAhcWSClient, StandaloneAhcWSRequest} | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.util.{Failure, Success} |
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
$ aws-vault exec admin-profile -- docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION -e AWS_SESSION_TOKEN -e AWS_SECURITY_TOKEN -it -v $PWD:/app/ -w /app/ hashicorp/terraform:0.11.8 init | |
Initializing the backend... | |
Backend configuration changed! | |
Terraform has detected that the configuration specified for the backend | |
has changed. Terraform will now check for existing state in the backends. | |
Error inspecting states in the "s3" backend: |
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 upickle.default._ | |
lazy val token = sys.env.getOrElse("ESA_TOKEN", throw new IllegalArgumentException("Not found the environment variable: ESA_TOKEN")) | |
case class PostsData(posts: Seq[Post], next_page: Int = 0) | |
case class Post(number: Int, name: String, wip: Boolean, created_by: Author) | |
case class Author(name: String) | |
implicit val postsDataR: Reader[PostsData] = macroR | |
implicit val postR: Reader[Post] = macroR |
OlderNewer