- JRebelを利用すると、アプリケーションの再起動なしで実行中のアプリケーションに加えた変更を即座に反映することができます(ホットリローディング)。まるでPHPのようにサクサク書けるッ!
- Scala開発者にはライセンスが$0で提供されます。Javaで利用する場合は購入してね☆彡
以下がインストールされているものとする。
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1. | |
7.0_03). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> import scala.collection.immutable.StringLike | |
import scala.collection.immutable.StringLike | |
scala> "a".format(_) | |
res0: Any* => String = <function1> |
package assetproviders { | |
import play.api.mvc.Action | |
import play.api.mvc.Controller | |
import play.api.mvc.AnyContent | |
import play.api.mvc.Call | |
/** | |
* This simple interface is meant to mimic the existing interface in Play 2.0 | |
* for the Assets controller it provides. By implementing this it is possible | |
* to mix and combine various AssetProviders to create a custom Asset controller |
## Note: the system property `sbt.global.base` was introduced in 0.10.1 | |
## sbt-0.10.0 still uses the default global directory in ~/.sbt | |
gseitz@QBallz ~/.sbt % find . -name '*target*' -prune -o -print | |
. | |
./0.10.1 | |
./0.10.1/plugins | |
./0.10.1/plugins/build.sbt | |
./0.10.1/plugins/project |
package controllers | |
import lib._ | |
import play.api.mvc._ | |
import play.api.libs.json._ | |
object Auth extends Controller { | |
val GITHUB = new OAuth2[GithubUser](OAuth2Settings( |
import language.experimental.macros | |
import language.implicitConversions | |
import scala.reflect.macros.Context | |
import scala.reflect.runtime.universe.Tree | |
class ReflectiveClosure[A, B](val tree: Tree, fn: Function1[A, B]) extends Function1[A, B] { | |
def apply(x: A) = fn(x) | |
} | |
object ReflectiveClosure { |
#!/usr/bin/env sh | |
if ! which md5sum > /dev/null; then | |
echo Install md5sum | |
exit 1 | |
fi | |
if ! which curl > /dev/null; then | |
echo Install curl | |
exit 1 |
[error] | |
[error] last tree to typer: term $outer | |
[error] symbol: value $outer (flags: <synthetic> <paramaccessor> <triedcooking> private[this]) | |
[error] symbol definition: private[this] val $outer: unit.ScalateHelperSpec | |
[error] tpe: <notype> | |
[error] symbol owners: value $outer -> anonymous class $anonfun -> value <local ScalateHelperSpec> -> class ScalateHelperSpec -> package unit | |
[error] context owners: value u -> value $anonfun -> value $anonfun -> method apply -> anonymous class $anonfun$apply$4 -> method apply -> anonymous class $anonfun$1 -> value <local ViewSpec> -> class ViewSpec -> package functional | |
[error] | |
[error] == Enclosing template or block == | |
[error] |
# This will automatically create or update model | |
onRender: => | |
[method, url] = if @model.isNew() | |
["POST", mymodels_path()] | |
else | |
["PUT", model_path(@model.id)] | |
@$(".upload").fileupload( | |
dataType: 'json' |
以下がインストールされているものとする。
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |