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
@(title: String)(content: Html) | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="css/bootstrap.min.css" rel="stylesheet"> | |
<link href="css/bootstrap-responsive.min.css" rel="stylesheet"> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="js/bootstrap.min.js"></script> | |
<title>@title</title> | |
</head> |
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 com.github.hexx.messageboard.Message | |
<table class="table table-striped"> | |
<thead> | |
<tr><th>Name</th><th>Message</th><th>Date</th></tr> | |
</thead> | |
<tbody> | |
@for(m <- Message.query.sort(_.date desc).asIterator) { | |
<tr><td>@m.name</td><td>@m.message</td><td>@m.date</td></tr> | |
} | |
</tbody> |
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
<form action="/" method="post" class="well form-inline"> | |
<label>Name:<input name="name"></label> | |
<label>Message:<input name="message"></label> | |
<input type="submit"> | |
</form> |
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 com.github.hexx.messageboard | |
import java.util.Date | |
import unfiltered.request._ | |
import unfiltered.response._ | |
import com.github.hexx.gaeds.{ Datastore, Mapper, Property } | |
import com.github.hexx.gaeds.Property._ | |
class Message( | |
val name: Property[String], |
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 com.github.hexx.rsstumblrbot | |
import java.util.Date | |
import scala.collection.JavaConverters._ | |
import com.sun.syndication.feed.synd.SyndEntry | |
import com.sun.syndication.io.{ SyndFeedInput, XmlReader } | |
import _root_.dispatch._ | |
import _root_.dispatch.gae.Http | |
import _root_.dispatch.oauth.{ Consumer, Token } | |
import unfiltered.request._ |
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.collection.JavaConverters._ | |
import com.google.appengine.api.datastore.Query | |
import com.google.appengine.api.datastore.Query.FilterOperator._ | |
import com.google.appengine.api.datastore.Query.SortDirection._ | |
val q = new Query(kind) | |
q.addFilter("age", GREATER_THAN_OR_EQUAL, 10) | |
q.addFilter("age", LESS_THAN_OR_EQUAL, 20) | |
q.addSort("age", ASCENDING) | |
q.addSort("name", ASCENDING) |
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
val ps = Person.query.filter(_.age #>= 10).filter(_.age #<= 20).sort(_.age asc).sort(_.name asc).asIterator |
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 com.github.hexx.gaeds.{ Mapper, Property } | |
import com.github.hexx.gaeds.Property._ | |
// データ定義 | |
class Person(val name: Property[String], val age: Property[Long]) extends Mapper[Person] { | |
def this() = this("", 0) | |
} | |
object Person extends Person |
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 com.google.appengine.api.datastore.{ DatastoreServiceFactory, Entity } | |
val ds = DatastoreServiceFactory.getDatastoreService | |
val kind = "Person" | |
// データ定義 | |
case class Person(name: String, age: Long) | |
// 保存 |
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
[app] | |
version: 0.0.1 | |
org: com.github.hexx | |
name: scalamblr | |
class: com.github.hexx.scalamblr.Scalamblr | |
[scala] | |
version: 2.9.1 | |
[repositories] | |
local | |
scala-tools-releases |