Sections:
- g11n
- Infrastructure upgrades
- Workshop fixes
- Enhancements (mostly new workshops)
- Bootstrapping workshops and translations
export PS1='\[\e[0;36m\][\A] \u@\h:\[\e[0m\e[0;32m\]\W\[\e[1;33m\]$(__git_ps1 " (%s)")\[\e[0;37m\] \$\[\e[0m\]' |
userSchema.statics.findOrCreateByAuth = function findOrCreateByAuth(id, name, provider, done) { | |
var User = this; | |
User.update( | |
{ _id: id, provider: provider }, | |
{ name: name, provider: provider }, | |
{ upsert: true }, | |
function(err, numAffected, details) { | |
if (err) { | |
return done(err); | |
} |
// Configuration globale au projet de JSHint | |
// ========================================= | |
// | |
// (Y compris celui intégré à votre EDI/éditeur, normalement) | |
// | |
// [Liste complète des options possibles](http://www.jshint.com/docs/options/) | |
{ | |
// Options de restriction | |
// ---------------------- |
function add(a, b, c) { | |
return a + b + c; | |
} | |
function partial(fx) { | |
var initial = Array.prototype.slice.call(arguments, 1); | |
return function() { | |
var args = Array.prototype.slice.call(arguments); | |
return fx.apply(this, initial.concat(args)); | |
}; |
Sections:
I hereby claim:
To claim this, I am signing this object:
var items; | |
// insertAt ////////////////////////////////// | |
function insertAt(arr, pos, item) { | |
} | |
items = ['one', 'two', 'three']; | |
console.assert(insertAt(items, 1, 'yo') === 4); |
cet article détaillé que j'ai écrit ensuite…
Je laisse le Gist ici pour ne pas casser vos liens, mais bon 😄
Chaque jour ou chaque semaine :
// Assumes http://brian.io/lawnchair/ and http://backbonejs.org/ | |
var collection = new MyCollection(); | |
var localStore = new Lawnchair({ name: 'my-cache' }, $.noop); | |
// First load from the cache, then fetch | |
function initialLoad() { | |
localStore.all(function(items) { | |
collection.reset(items, function() { | |
collection.fetch(); |
Function.prototype.throttle = function(/* … */) { | |
var f = this; | |
// … | |
return function() { | |
// … | |
return f.apply(this, arguments); | |
}; | |
}; |