Serialize an object to a query string.
Optionally override the default separator ('&'
) and assignment ('='
)
characters.
Example:
function oncePerEventLoopFunc(fn){ | |
var queued, cbs; | |
queued = false; | |
cbs = []; | |
return function(cb){ | |
cbs.push(cb); | |
if (queued) { | |
return; | |
} | |
queued = true; |
aoeu |
function moveFile(source, dest, cb){ | |
fs.rename(source, dest, function(err){ | |
var ins, outs, had_error; | |
if (!err) { | |
return cb(); | |
} | |
if (err.code !== 'EXDEV') { | |
return cb(err); | |
} | |
ins = fs.createReadStream(source); |
var Plugin, fs, zipstream, path, safePath, express, findit, Download; | |
Plugin = require('../plugin'); | |
fs = require('fs'); | |
zipstream = require('zipstream'); | |
path = require('path'); | |
safePath = require('../futils').safePath; | |
express = require('express'); | |
findit = require('findit'); | |
module.exports = Download = (function(superclass){ | |
Download.displayName = 'Download'; |
"templates": { | |
// lydian audio processing | |
"b5eec8b0-2925-11e2-81c1-0800200c9a66": { | |
"original": { | |
"type": "store" | |
}, | |
"waveform": { | |
"type": "waveform", | |
"settings": { | |
"width": 1800, |
# compile with http://satyr.github.com/cup/ | |
PROGRESS_TIME_REGEX = // | |
^ In:([\d.]+)% # progress | |
\s+ (\d\d):(\d\d):([\d.]+) # time that has been encoded | |
\s+ \[(\d\d):(\d\d):([\d.]+)\] # time left to encode | |
\s+ Out:([\d.\w]+) # file size of output | |
\s+ \[[\s|\-!=]+\] # clip meter | |
\s+ (?:Hd:([\d.]+))? # dunno wtf this is | |
\s+ Clip:(\d+) # clip count | |
\s* $ |
# What's easier to read? | |
add_submission(Submission.from_upload(user, upload)).tap do |submission| | |
publish('submission.uploaded', submission.to_hash) | |
end | |
# or |
/node_modules |
zfill1 | |
it took 149 | |
zfill2 | |
it took 629 |