Skip to content

Instantly share code, notes, and snippets.

@gkojax
gkojax / aaa.scala
Created April 10, 2013 08:30
64文字の文字列を8文字ずつに区切ってリスト化する
//
// 64文字の文字列を8文字ずつに区切ってリスト化する
//
// 1234567890123456789012345678901234567890123456789012345678901234
// -> List(12345678, 90123456, 78901234, 56789012, 34567890, ....)
//
def aaa(s: String, l: Int): List[String] = {
def bbb(s: String, e: List[String]): Pair[String, List[String]] = s match {
case s if s.length < l =>
(s, e :+ s)
@gkojax
gkojax / aaa.scala
Created April 23, 2013 11:56
普通にこれでplay updateできるんだけどなあ
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "aaa"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
@gkojax
gkojax / exe.scala
Created April 24, 2013 16:41
0 secondsとか1 minutesみたいなの書きたい。
import play.api._
import play.api.libs.concurrent.Akka
import akka.actor._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.language.postfixOps
actorSystem.scheduler.schedule(0 seconds, 1 minutes, ...
@gkojax
gkojax / a.scala
Last active December 17, 2015 19:28
社内勉強会でusingについて説明
// 単純なopen、close
val fileName = "text.txt"
val resource = new BufferedReader(new FileReader(new File(fileName)))
resource.readLine
resource.close
git diff --cached
git log -p
git log --oneline --graph
git log --after=2013-08-14 --author="t_shinozaki"
git commit --amend
git blame -s
git rebase -i HEAD~
http://www.backlog.jp/git-guide/stepup/stepup1_1.html
-- select
-- A.asmst_id,
-- B.email, B.entry_group_cd,
-- C.website_name
select count(*)
from (
select
a.asmst_id
from (