Skip to content

Instantly share code, notes, and snippets.

@publickeating
publickeating / gist:778432
Created January 13, 2011 19:25
File upload server response
res.send(JSON.stringify({
state: 'success',
fileName: file.filename,
mimeType: file.mime,
imagePath: relativePath
}), {
'Content-Type': 'text/plain'
}, 200);
@publickeating
publickeating / binding.js
Created January 3, 2011 17:05
Proposed addition to expose isForward
/**
Returns the direction of the binding. If isForward is YES, then the value
being passed came from the "from" side of the binding (i.e. the "Binding.path"
you named). If isForward is NO, then the value came from the "to" side (i.e.
the property you named with "propertyBinding"). You can vary your transform
behavior if you are based on the direction of the change.
@returns {Boolean}
*/
isForward: function() {