This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'jquery', | |
'underscore', | |
'backbone', | |
'backbone.marionette', | |
'backbone.virtual-collection', | |
'hbs!navigation/templates/list', | |
'hbs!navigation/templates/listItem' | |
], function( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add multiple servers at different ports for load balancing | |
upstream node { | |
server 127.0.0.1:3005; | |
} | |
# the nginx server instance | |
server { | |
listen 0.0.0.0:80; | |
server_name {{ your_app_name }} {{ your.domain.com }}; | |
access_log /var/log/nginx/{{ your.domain.com }}.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Log events fired on given DOM element | |
monitorEvents(elem); | |
unmonitorEvents(elem); | |
//See a trace of how we reached this line. | |
console.trace(); | |
//Performance timing | |
console.time('Timer'); | |
console.timeEnd('Timer'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Timeseries format | |
{ | |
device_legend: [device1, device2], | |
data_legend: [[dataType1, dataType2], [device2_dataType1]], | |
data: [ | |
{ | |
x: timestamp, | |
y: [ | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//New constructor | |
var cons = function(){ | |
var property_private = 'bye'; | |
this.property_public = 'see ya'; | |
//Instead of returning this, return only what needs | |
//to be accessible | |
return { | |
property_public: this.property_public, | |
method_public: function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Module */ | |
define(['dep'], function(dep){ | |
var Module = {}; | |
// Instantiate a local controller | |
Module.controller = new Backbone.Controller.extend({ | |
foo: bar | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DIRECTORY STRUCTURE | |
module1.js | |
module2.js | |
module2/ | |
- model.js | |
- view1.js | |
- view2.js |
NewerOlder