- Play の WebSocket で何か
- Akka を使った何か
- ディスク IO に関した何か
- Play scaffold sbt plugin
- DSL をつくる?
- giter8 で何か
- Play の javascriptRouter
- クローラシステム
- Node.js のサンプルを移植
- AWS と連携
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 scala.xml._ | |
| val xml: Elem = XML.load("./input.xml") | |
| val formatted: String = new PrettyPrinter(80, 2).format(xml) | |
NOTE: The following is a Japanese translation for the guidelines of Typesafe Developer Contest.
http://typesafe.com/resources/developer-contest
Typesafe 社は、Scala、Akka または Play(もしくはそのすべて!)を使ったプログラミングのデモンストレーションとなる、素晴らしいアプリケーションを求めています。
このようなアプリケーションの例として提供できる、誇れるプログラムがありますか?もしあれば、あなたのエントリを心よりお待ちしております。
Martin Odersky が JAX Java Ambassador Award で獲得した賞金をこのコンテストに寄付しました。
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
| access_key_id: xxx | |
| secret_access_key: yyy |
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
| case class SQLRunner(sql: String) { | |
| def run(): Seq[Map[Symbol, Any]] = { | |
| try { | |
| SQL(sql).map(_.toSymbolMap()).list.apply() | |
| } catch { case e: java.sql.SQLException => | |
| val result = SQL(sql).execute.apply() | |
| Seq(Map('RESULT -> 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
| trait Tx { self: Controller => | |
| def localTx[A](action: Action[A]) = LocalTxActionDecorator[A](action) | |
| } | |
| case class LocalTxActionDecorator[A](action: Action[A]) extends Action[A] { | |
| def parser: BodyParser[A] = action.parser | |
| override def apply() = DB localTx { implicit s => action.apply() } |
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
| // http://www.eclipse.org/jgit/download/ | |
| resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven" | |
| libraryDependencies += "org.eclipse.jgit" % "org.eclipse.jgit" % "[2.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
| def redirect(arg) | |
| new_host = 'new.example.com' | |
| uri = arg["REQUEST_URI"] | |
| [ | |
| 302, | |
| {'content-type' => 'text/plain', 'location' => "http://#{new_host}#{uri}"}, | |
| "http://#{new_host}#{uri}".chars | |
| ] | |
| end | |
| run method(:redirect) |
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
| libraryDependencies ++= Seq( | |
| "com.github.seratch" %% "scalikejdbc" % "[1.3,)", | |
| "org.slf4j" % "slf4j-simple" % "1.6.4", | |
| "org.hsqldb" % "hsqldb" % "[2,)" | |
| ) |
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
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| package Seq; | |
| sub apply { | |
| my ($class, @seq) = @_; | |
| bless { seq => \@seq }, $class; |