Skip to content

Instantly share code, notes, and snippets.

@jr314159
jr314159 / karma.coffee.erb
Created January 15, 2014 16:35
Karma rake task
# Karma configuration
# Generated on Tue Aug 20 2013 16:26:25 GMT-0400 (EDT)
module.exports = (config) ->
config.set
# base path, that will be used to resolve all patterns, eg. files, exclude
basePath: '..'
# frameworks to use
@jr314159
jr314159 / super-model.js.coffee
Created March 20, 2013 13:51
Another relational model implementation for Backbone, designed to work with nested attributes in Rails
class Backbone.Localytics.Models.SuperModel extends Backbone.Model
#modelName: null # The overridden sync method looks to see if this is set for including root in JSON
# Define how JSON properties should be parsed to Backbone models or collections:
# associations:
# kitties: Cats
# dog: Dog
# Parse nested data for associated models from the attributes hash into respective collections or models