Skip to content

Instantly share code, notes, and snippets.

View sidazhang's full-sized avatar

Sidney Zhang sidazhang

  • Facebook
  • San Francisco
View GitHub Profile
@sidazhang
sidazhang / index.js
Created July 31, 2014 16:04
bookshelf
// format and parse (turning snakecase into camelcase and vice versa)
var S = require('string')
var _ = require('underscore')
var format = function(attrs) {
return _.reduce(attrs, function(memo, val, key) {
memo[S(key).underscore().s] = val
console.log(memo)
return memo;
}, {});
}