En attendant de me décider, quelques liens
##Qu'est-ce que c'est ?
##1ers pas :
En attendant de me décider, quelques liens
##Qu'est-ce que c'est ?
##1ers pas :
(rough-cut for Backbone Fundamentals)
As we learned earlier in the book, the validate
method on a Model is called before set
and save
, and is passed the model attributes updated with the values from these methods.
By default, where we define a custom validate
method, Backbone passes all of a Model's attributes through this validation each time, regardless of which model attributes are being set.
This means that it can be a challenge to determine which specific fields are being set or validated without being concerned about the others that aren't being set at the same time.
#Play2 : Les Iteratees expliqués aux humains... francophones!
Disclaimer : Ce qui suit est la traduction d'un article anglophone paru sur le blog mandubian.com
Vous pouvez retrouver l'article original ici
Vous avez probablement remarqué une nouvelle fonctionnalité intrigante de Play2 nommée Iteratee
(ainsi que ses compagnons Enumerators
et Enumeratee
).
Le but de cet article est d'essayer de rendre le concept d'Iteratee compréhensible pour le plus grand nombre avec des arguments simples, en évitant l'approche mathématique / fonctionnelle.
Cet article ne prétend pas tout expliquer à propos des Iteratee / Enumerator / Enumeratee mais traite plutôt les idées qui se cachent derrière.
#-webkit-web-inspector #toolbar { | |
background: #cdcdcd !important; | |
height: 36px !important; | |
} | |
#-webkit-web-inspector #main { | |
top: 36px !important; | |
} | |
#-webkit-web-inspector .toolbar-item.elements:hover:after { | |
content: "elements"; | |
z-index: 9999; |
/* Cranium MVC | |
* A minimalist MVC implementation written for | |
* demonstration purposes at my workshops | |
* http://addyosmani.com | |
* Copyright (c) 2012 Addy Osmani; Licensed MIT */ | |
var Cranium = Cranium || {}; | |
// Set DOM selection utility |
package controllers | |
import play.api._ | |
import libs.ws.WS | |
import play.api.mvc._ | |
import com.micronautics.paypal.{TransactionProcessor, PaypalTransactions} | |
import java.net.URLEncoder | |
import concurrent.{Await, ExecutionContext} | |
import concurrent.duration.Duration | |
import java.util.concurrent.TimeUnit |
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
meta:{ | |
banner:'/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %>\n' + | |
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' + |
Code examples from this stack overflow answer.
val mongoToFE = | |
__.json.update((__ \ 'id).json.copyFrom( (__ \ '_id \ '$oid).json.pick )) andThen | |
(__ \ '_id).json.prune | |
val FEtoMongo = | |
__.json.update((__ \ '_id \ '$oid).json.copyFrom( (__ \ 'id).json.pick )) andThen | |
(__ \ 'id).json.prune | |
Async { | |
val items = collection.find(BSONDocument("_id" -> objectId)).cursor[JsObject] |