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
sbt.ResolveException: unresolved dependency: com.github.scct#scct_2.10;0.2-SNAPSHOT: not found |
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 java.nio.charset.Charset | |
import scala.util.Random | |
/** | |
* ランダムに文字列を一つだけ埋め込むことにできるテンプレートを取得する | |
*/ | |
object RandomTemplateProvider { | |
private val templates = Seq( | |
"<html><body><h1>%s</h1></body></html>", | |
"# %s", |
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 DeleteDuplicate extends App { | |
/** | |
* メッセージを受け取りテンプレートに埋め込んだ上でそのUTF-8でのバイト数と内容を表示する | |
* @param message | |
*/ | |
def printByteLengthAndContent(message: String) = printTargetLengthAndContent(message, { |
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
sudo su - | |
cd /usr/local/src | |
wget "http://www.erlang.org/download/otp_src_17.0.tar.gz" | |
cd otp_src_17.0 | |
./configure --enable-smp-support \ | |
--enable-m64-build \ | |
--enable-halfword-emulator \ | |
--disable-native-libs \ | |
--disable-sctp \ | |
--enable-threads \ |
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
" erlangのシンタクスハイライト | |
NeoBundle 'vim-erlang/vim-erlang-runtime' | |
" erlangのオムニ補完 | |
NeoBundle 'vim-erlang/vim-erlang-omnicomplete' | |
""""" erlang用設定 """""""" | |
" erlファイルをerlangとして認識する | |
au BufNewFile,BufRead *.erl setf erlang | |
" :makeでerlang構文チェック | |
au FileType erlang setlocal makeprg=erlc\ % |
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
-module(geometory). | |
-export([area/1]). | |
area({rectangle, Width, Ht}) -> Width * Ht; | |
area({circle, R}) -> 3.14159 * R * R. |
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 sbt._ | |
import Keys._ | |
import play.Project._ | |
object ApplicationBuild extends Build { | |
val appName = "layered" | |
val appVersion = "1.0-SNAPSHOT" | |
override def settings = super.settings ++ com.typesafe.sbtidea.SbtIdeaPlugin.ideaSettings |
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 q = (for {r .where(_.channel is target.getName) | |
.where(_.nickname is nickname) | |
val length: Int = q.list().length |
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 q = (for {r .where(_.channel is target.getName) | |
.where(_.updateAt >= countedDate) | |
.groupBy(_.nickname) | |
val qGroup = q.map { | |
case (nickname, grouped) => (nickname, grouped.length) | |
} | |
val qSort = qGroup.sortBy(_._2.desc) |
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 java.util.concurrent.Semaphore | |
import dispatch._ | |
import dispatch.Defaults._ | |
/** | |
* SlackのAPIへの操作を行うクライアント | |
* 制限に引っかかららないように1秒間に1回しか実行できない制御をかけてある | |
*/ | |
object SlackClient { |