Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
brianjmiller / Base class
Last active December 25, 2015 04:39
Basic Collection view implementation, there are better more thorough ones.
define(
[
"backbone",
"templates",
"underscore"
],
function (Backbone, templates, _) {
"use strict";
var CLASS_EMPTY = "ws-list-empty";
@brianjmiller
brianjmiller / gist:7042658
Last active December 25, 2015 21:29
Backbone .save handlers
user.save(
userSaveData,
{
success: _.bind(this._registerSuccess, this),
error: _.bind(this._registerError, this)
}
);
_registerSuccess: function () {
console.log("views/signUp::_registerSuccess");
@brianjmiller
brianjmiller / base.js
Last active January 1, 2016 20:49
Base BB View
return Backbone.View.extend(
{
_nodes: null,
renderCfg: function () {
return this._renderCfg || {};
},
renderContext: function () {
console.log("views/base::renderContext");
var dbh = require("../migrations"),
relationName = "time_zones";
exports.up = function (next) {
dbh.schema.createTable(
relationName,
function (table) {
table.string("code", 50).primary();
table.timestamps();
table.integer("utc_offset").notNullable();
@brianjmiller
brianjmiller / Gruntfile.js
Last active August 29, 2015 14:01
Backbone-stack updates
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
/**
* Watching
* ========