Skip to content

Instantly share code, notes, and snippets.

@grimrose
grimrose / ScalaFutureSupport.scala
Last active September 20, 2019 19:14
AirSpec(19.9.7) for Scala Future
package ninja.grimrose.sandbox
import wvlet.airframe.SourceCode
import wvlet.airspec.AirSpec
import wvlet.airspec.spi.AssertionFailure
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
trait ScalaFutureSupport { this: AirSpec =>
@grimrose
grimrose / Server.scala
Last active March 9, 2019 00:48
airframe-http-finagle(19.2.0) + zipkin-finagle-http(2.0.11) or finagle-opencensus-tracing(19.2.0) sample
import com.twitter.finagle.Http
import com.twitter.finagle.http.{ Request, Response }
import com.twitter.finagle.tracing.Tracer
import wvlet.airframe._
import wvlet.airframe.http.{ Endpoint, HttpMethod }
import wvlet.airframe.http.finagle.FinagleServer.FinagleService
import wvlet.airframe.http.finagle._
import wvlet.airframe.http.{ ControllerProvider, ResponseHandler, Router }
import wvlet.log.LogFormatter.SourceCodeLogFormatter
@grimrose
grimrose / LT.md
Created January 15, 2019 11:17
https://gcpug-tokyo.connpass.com/event/113257/ GCPUG Tokyo Stackdriver Day January 2019 #gcpug

OpenCensusとStackdriver Traceで分散トレーシングを見てみよう

お前、誰よ

@grimrose
grimrose / console.log
Created November 21, 2018 15:36
sbt new playframework/play-scala-seed.g8
00:34:01:scala-projects$ which sbt
/Users/grimrose/.sdkman/candidates/sbt/current/bin/sbt
00:34:08:scala-projects$ sbt sbtVersion
[warn] No sbt.version set in project/build.properties, base directory: /Users/grimrose/Dropbox/IdeaProjects/scala-projects
[info] Loading settings for project global-plugins from build.sbt,idea.sbt ...
[info] Loading global plugins from /Users/grimrose/.sbt/1.0/plugins
[info] Set current project to scala-projects (in build file:/Users/grimrose/Dropbox/IdeaProjects/scala-projects/)
[info] 1.2.4
00:34:35:scala-projects$ sbt new playframework/play-scala-seed.g8
[info] Loading settings for project global-plugins from build.sbt,idea.sbt ...
@grimrose
grimrose / sm2018.md
Last active March 18, 2018 05:14
ScalaMatsuri 2018 業務システム in Scalaの概要 http://2018.scalamatsuri.org/index.html#day2 #scalamatsuri
@grimrose
grimrose / Main.elm
Created February 24, 2018 13:44
Elmなんか作ろう会 #6 https://elm-jp.connpass.com/event/79821/ #moku2_elm
module Main exposing (..)
import Html exposing (Html, div, h1, h2, img, p, text)
--import Html.Attributes exposing (src)
import Http exposing (Request)
import Json.Decode as Decode
--import Json.Encode as Encode
---- MODEL ----
@grimrose
grimrose / Dockerfile
Created January 21, 2018 14:29
cat sample.puml | docker run --rm plantuml -p -tsvg > img/sample.svg
FROM openjdk:alpine
ENV PLANTUML_VERSION 1.2018.0
ENV LANG ja_JP.UTF-8
RUN echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
WORKDIR /app

とあるマーケティング部隊とエンジニアとScalaの導入

お前、誰よ

  • よしだ

  • とある人材紹介会社のマーケティング部門のデータエンジニア(自称)

@grimrose
grimrose / sample.scala
Last active August 21, 2017 15:34
akka streams sample
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl._
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, ExecutionContext, Future}
implicit val sys: ActorSystem = ActorSystem("akka-streams-sample")
implicit val mat: ActorMaterializer = ActorMaterializer()
@grimrose
grimrose / build.gradle
Created April 29, 2017 12:29
shadow + launch4j plugin study
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.edu.sc.seis.gradle:launch4j:2.3.0'
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4"
}