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 com.example.domain | |
import com.example.domain | |
import org.scalatest.funspec.AnyFunSpec | |
import scala.reflect.runtime.universe | |
sealed trait IError { | |
val template: String | |
} |
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 cats.data.Validated.{Invalid, Valid} | |
import cats.syntax.apply._ | |
import io.circe.generic.semiauto.deriveEncoder | |
import io.circe.parser.decodeAccumulating | |
import io.circe.{Encoder, _} | |
import io.tabmo.circe.extra.rules.IntRules | |
import io.tabmo.json.rules._ | |
/** | |
* 下記の方法はfield 22個まででの対応方法がわかんない。複数のErrorが帰る |
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 javax.inject._ | |
import play.api._ | |
import play.api.http.DefaultHttpErrorHandler | |
import play.api.mvc.Results._ | |
import play.api.mvc._ | |
import play.api.routing.Router | |
import play.core.server.akkahttp.AkkaHeadersWrapper |
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
$ npm outdated | |
Package Current Wanted Latest Location | |
truffle 4.1.3 4.1.5 4.1.5 study_solidity | |
zeppelin-solidity 1.7.0 1.8.0 1.8.0 study_solidity |
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
# frozen_string_literal: true | |
require 'yosenabe/config' | |
module Yosenabe | |
module Mixin | |
# 基本のconfigload用 | |
module MixinConfig |
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 rotation(file_path, max_history) | |
if max_history.nil? | |
return | |
end | |
allow_filenames = 1.upto(max_history).to_a.map { |i| | |
date = Date.today.prev_day(i) | |
"#{file_path}.#{date.strftime('%Y%m%d')}" | |
} | |
allow_filenames.unshift(file_path) |
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
CSV.open("/Users/a_nishiyama/Kokodayo.com/ruby_examples/data/sample_new.csv", 'w') do |write| | |
CSV.foreach("/Users/a_nishiyama/Kokodayo.com/ruby_examples/data/sample.csv") do |columns| | |
# columns.each {|header, field| field += "test";p field } | |
# columns.each { |head, field| columns[head] = "test" } | |
columns.unshift("hoge") # 行の先頭に追加 | |
columns[1] = "置換" # 行の置き換え | |
columns.push $. == 1 ? 'head' : 'hoge' # 行の先頭に追加 | |
write << columns | |
end |
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 com.example.collection | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.duration.Duration | |
import scala.concurrent.{Await, Future} | |
/** | |
* Queueサンプル | |
*/ | |
object QueueSample extends App { |
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
object OptionSample extends App { | |
def stringEmptyToNone(code: Option[String]): Option[String] = { | |
code match { | |
case Some(s: String) => { | |
s.nonEmpty match { | |
case true => Some(s) | |
case _ => None | |
} |
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 org.sisioh.dddbase.core.model.{Entity, Identifier} | |
import org.specs2.mutable.Specification | |
class EntitySpec extends Specification { | |
case class ManId(value: Long) | |
extends Identifier[Long] |
NewerOlder