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 org.slf4j.bridge.SLF4JBridgeHandler | |
| import wvlet.airframe._ | |
| import wvlet.log.Logger | |
| object Main extends App { | |
| Logger.init | |
| SLF4JBridgeHandler.removeHandlersForRootLogger() | |
| SLF4JBridgeHandler.install() |
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 org.slf4j.LoggerFactory | |
| trait DoSomething { | |
| private val logger = LoggerFactory.getLogger(classOf[DoSomething]) | |
| def doLogging(): Unit = { | |
| logger.info("doing something") | |
| } | |
| } |
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
| sbt.version=1.3.13 |
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
| 2020-04-29 21:18:53.719+0900 info [LifeCycleManager] [session:35d176f7] Starting a new lifecycle ... - (LifeCycleManager.scala:260) | |
| 2020-04-29 21:18:53.741+0900 info [LifeCycleManager] [session:35d176f7] ======== STARTED ======== - (LifeCycleManager.scala:264) | |
| 2020-04-29 21:18:54.584+0900 info [LifeCycleManager] [session:35d176f7 -> session:18025ced] Starting a new lifecycle ... - (LifeCycleManager.scala:260) | |
| 2020-04-29 21:18:54.585+0900 info [LifeCycleManager] [session:35d176f7 -> session:18025ced] ======== STARTED ======== - (LifeCycleManager.scala:264) | |
| 2020-04-29 21:18:54.588+0900 info [Inner] init... - (Main.scala:36) | |
| 2020-04-29 21:18:54.590+0900 info [Inner] [1] exec... - (Main.scala:44) | |
| 2020-04-29 21:18:54.590+0900 info [LifeCycleManager] [session:35d176f7 -> session:18025ced] Stopping the lifecycle ... - (LifeCycleManager.scala:268) | |
| 2020-04-29 21:18:54.593+0900 info [Inner] shutdown... - (Main.scala:40) | |
| 2020-04-29 21:18:54.594+0900 info [LifeCycleManager] [session:35d176f7 -> session:1 |
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
| package dev.zerosum.sandbox.base | |
| import java.time._ | |
| import wvlet.airframe._ | |
| trait DateTimeSupport { | |
| private lazy val clock = bind[Clock] |
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
| function peco-docker-container-stop () { | |
| local selected=$(docker container ls | tail -n +2 | peco) | |
| if [ -n "$selected" ]; then | |
| BUFFER=`echo ${selected} | awk '{print $1}' | xargs -I {} docker container stop {}` | |
| fi | |
| } |
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 loop(numer: Int, denom: Int, digits: Seq[(Int, Int)]): Int = { | |
| val quot = numer / denom | |
| val rem = numer % denom | |
| val digit = (quot, rem) | |
| if (rem == 0) { | |
| 0 | |
| } else if (digits.contains(digit)) { | |
| digits.indexWhere(_ == digit) + 1 | |
| } else { |
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
| Array.prototype.filterNot = function (callback) { | |
| var result = []; | |
| for (e of this) { | |
| if (!callback(e)) { | |
| result.push(e); | |
| } | |
| }; | |
| return result; | |
| } |
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
| buildscript { | |
| repositories { | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath 'com.sahlbach.gradle:gradle-jetty-eclipse-plugin:1.9.+' | |
| } | |
| } | |
| apply plugin: 'scala' |
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
| buildscript { | |
| repositories { | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath 'com.bmuschko:gradle-tomcat-plugin:2.1' | |
| } | |
| } | |
| apply plugin: 'scala' |
NewerOlder