CREATE TABLE users (
id INTEGER PRIMARY KEY,
name VARCHAR(256) NOT NULL
)
CREATE TABLE groups (
id INTEGER PRIMARY KEY,
name VARCHAR(256) NOT NULL
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 ApiInjector { | |
var twitter : TwitterApi = new TwitterApiImpl; | |
//他にもいろいろなサービス | |
} |
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 lombok.experimental.ExtensionMethod; | |
// @ExtensionMethod({ String.class }) // Compile Error. | |
@ExtensionMethod({ Extensions.class }) | |
public class Main { | |
public static void main(String[] args) { | |
System.out.println("Hello, %s".format("World.")); // => "Hello, World." | |
} | |
} |
def cond[A](value: A)(f: PartialFunction[A, SQLBuilder => SQLBuilder]): SQLBuilder
こんな感じの(実際にはSQLBuilderはサブクラス型にしないとだけど)あれば下みたいに書けるかなー
val id: Option[Int] = ...
val name: Option[String] = ...
色んなSQLをSquerylで書くと? のパクリです。
テーブル名とかカラム名はちょっと弄りました。
SELECT *
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
みなさまRubyKaigiお疲れ様でしたー。素敵なKaigiに再会できてうれしかったです。 | |
RubyKaigiまわりで、同じ分野の問題提起が二つありましたねぇ。 | |
一つはKaigi中での、「台湾の女の子はKawaii、だからRubyKaigi Taiwanに来るべき」という発言、 | |
それを笑いで迎えた場内に対して、女性への配慮が足りないだろうという意見。 | |
https://gist.github.com/kyanny/5694201 | |
もう一つは、続くRubyHirobaでの、ポルノに関しての情報処理技術についてのLTがあったこと。 | |
(そして、実際にそれを聞いて傷ついた女性が存在し、問題が提起されました) | |
RubyhirobaはRubyKaigiとは独立した、せっかく東京にRubyistがたくさん居るんだから交流しよう!という、 | |
LTとWorkshopと交流の場を提供するイベントです。 |
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 models | |
import play.api.db._ | |
import play.api.Play.current | |
import anorm._ | |
import anorm.SqlParser._ | |
case class User(email: String, name: String, password: String) |
##前提 Windows上でskinny-blank-appから起動するこを前提としています。 他の方法から起動されるかたは置き換えて見て下さい。
##SBTにデバッグオプションを追加 sbt.batに下記のオプションを追加します。 ※address(ポート番号)は任意です。 -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
デフォルトであれば下記の様になっているかと思います。
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
Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_45). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import scala.language.experimental.macros | |
import scala.language.experimental.macros | |
scala> import scala.reflect.macros.Context | |
import scala.reflect.macros.Context |
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 controller | |
import akka.actor.ActorSystem | |
import scala.concurrent.{Promise, ExecutionContext} | |
import org.scalatra.{AsyncResult, FutureSupport} | |
import dispatch._ | |
import skinny.controller.SkinnyServlet | |
object DispatchAkka { | |
def retrievePage()(implicit cxt: ExecutionContext): Future[String] = { |