Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Last active December 14, 2015 01:49
Show Gist options
  • Select an option

  • Save jiggliemon/5009595 to your computer and use it in GitHub Desktop.

Select an option

Save jiggliemon/5009595 to your computer and use it in GitHub Desktop.

Revisions

  1. jiggliemon revised this gist Feb 22, 2013. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions validate.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    var Validate = function () {

    }

    Validate.prototype = {
    listeners: {
    'data.set':'validate'
    'init': 'setup'
    },
    setup: function () {

    },
    validate: function (key, data) {
    if (this.rules[key]) {
    // somehow validate this junk.
    // otherwise throw an error?
    }
    }
    }
  2. jiggliemon revised this gist Feb 22, 2013. 2 changed files with 13 additions and 0 deletions.
    File renamed without changes.
    13 changes: 13 additions & 0 deletions localstorage.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    var LocalStorage = function () {

    }

    LocalStorage.prototype = {
    listeners: {
    'saved':'save'
    },
    save: function (err, data) {
    if (!err)
    localStorageAllTheThings(data)
    }
    }
  3. jiggliemon created this gist Feb 21, 2013.
    11 changes: 11 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    var Obj = require('parsed/object')
    var LocalStorage = require('parsed/object/localstorage')
    var Validation = require('parsed/object/validation')

    var Task = Obj.create('Task', {
    implement: [LocalStorage, Validation]
    }, {
    init: function () {

    }
    })