超雑にまとめました。修正してください。
登場人物
- アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
- 後輩: 頼んでばっかしで役に立たない。
- サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
- プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
// 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) { |
## 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 |
FIXME: | |
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8 | |
or | |
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found | |
gem uninstall nokogiri libxml-ruby | |
brew update | |
brew uninstall libxml2 |
package controllers | |
import lib._ | |
import play.api.mvc._ | |
import play.api.libs.json._ | |
object Auth extends Controller { | |
val GITHUB = new OAuth2[GithubUser](OAuth2Settings( |
def foo[A,B](in:Option[A])(valid:PartialFunction[Option[A],Either[B,A]])(invalid:PartialFunction[Option[A],Either[B,A]])(other: =>Either[B,A]) = { | |
if(!valid.isDefinedAt(in) && !invalid.isDefinedAt(in)) { | |
other | |
}else{ | |
(valid orElse invalid)(in) | |
} | |
} | |
def getFirstData(id:String) = { | |
foo(Cache.get(id)){ |
# 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' |
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 { |
[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] |
[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] |