This file contains 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
// decreases request count on rapid-fire one model saves | |
// extended backbone.js sync function. uses setTimeout to batch multiple saves on one model in one http request. | |
// if client side needs immediate answer from server for changes in model attributes, | |
// pass { immediate: true } in model save options if { wait: true } is not used already. | |
Backbone._sync=Backbone.sync | |
Backbone.sync = function(method, model, options){ | |
var maxResetCount=5 // how many times to delay save | |
var saveBufferSize=3000 // for how many microseconds save is delayed | |
var immediate=options['wait'] || options['immediate'] || false |
This file contains 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
/** | |
* A quick little thingy that takes a Stream instance and makes | |
* it emit 'line' events when a newline is encountered. | |
* | |
* Usage: | |
* ‾‾‾‾‾ | |
* emitLines(process.stdin) | |
* process.stdin.resume() | |
* process.stdin.setEncoding('utf8') | |
* process.stdin.on('line', function (line) { |
This file contains 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
NewerOlder