Skip to content

Instantly share code, notes, and snippets.

@seratch
seratch / build.sbt
Created September 11, 2012 02:58
ScalikeJDBC Left Join Query Example
libraryDependencies ++= Seq(
"com.github.seratch" %% "scalikejdbc" % "[1.3,)",
"org.slf4j" % "slf4j-simple" % "1.6.4",
"org.hsqldb" % "hsqldb" % "[2,)"
)
@guillaumebort
guillaumebort / 1.sql
Created May 25, 2012 15:17
Play 2.0/Anorm
# --- !Ups
CREATE TABLE users(
email VARCHAR(255) NOT NULL PRIMARY KEY,
name VARCHAR(255)
);
CREATE TABLE subjects(
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title LONGTEXT NOT NULL,
@seratch
seratch / plugins.sbt
Created April 1, 2012 05:34
Play20's project/plugins.sbt for IntelliJ IDEA users
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0")
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
@kmizu
kmizu / gist:1876800
Last active December 22, 2019 00:05 — forked from gakuzzzz/gist:1865400
Scala環境構築

Scala 開発環境構築手順

前提条件

  • JDKがinstall済みであること
  • java コマンドに環境変数Pathが通っていること
@ogatatsu
ogatatsu / joinRight
Created December 13, 2011 17:02
joinRightサンプル
scala> val a: Either[Exception, Either[Exception, Int]] = Right(Right(10))
a: Either[Exception,Either[Exception,Int]] = Right(Right(10))
scala> a.joinRight
res0: Either[Exception,Int] = Right(10)
scala> val b: Either[Exception, Either[Exception, Int]] = Right(Left(new Exception("a")))
b: Either[Exception,Either[Exception,Int]] = Right(Left(java.lang.Exception: a))
scala> b.joinRight
@mumoshu
mumoshu / play20-beta-api-memo.scala
Created November 25, 2011 10:58
Play 2.0 betaのAPIメモ
import play.api.WS
import play.api.mvc.Controller
object Posts/*名詞複数形*/ extends Controller {
/**
* "Hello Play 2.0!"という文字列を返すアクション
* argがパラメータとして指定されていなければ、Playにより400 BAD REQUESTが返される。
*/
def index/*アクション名*/(arg: String /*リクエストパラメータ*/) = Action {