This file contains hidden or 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
# snipped all the outer require js stuff | |
class InnerViewBase extends Chaplin.View # Or whatever your base view is | |
autoRender: true | |
container: "#innerViewContainer" | |
containerMethod: "html" | |
initialize: (templateName) -> | |
@template = require templateName |
This file contains hidden or 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
var fs = require("fs"), | |
path = require("path"); | |
var common = require("./lib/common"); | |
module.exports = function(grunt) { | |
var Ss = grunt.config("Ss"), | |
_ = grunt.util._, | |
async = grunt.util.async; |
This file contains hidden or 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
var express = require("express"); | |
var routes = require("./lib/routes"); | |
// You're existing code to instantiate the app. | |
var app = express(); | |
// ... and configure it... | |
// Set your routes. |
This file contains hidden or 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.exports = function(grunt) { | |
grunt.registerMultiTask('{%= short_name %}', 'Your task description goes here.', function() { | |
// Merge task-specific and/or target-specific options with these defaults. | |
var options = this.options({ | |
punctuation: '.', | |
separator: ', ' | |
}); | |
// Iterate over all specified file groups. |
This file contains hidden or 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
var rightNow = new Date(), | |
chicagoWallTime = WallTime.UTCToWallTime(rightNow, "America/Chicago"), | |
osloWallTime = WallTime.UTCToWallTime(rightNow, "Europe/Oslo"), | |
backToUTCTime = WallTime.WallTimeToUTC("America/Chicago", chicagoWallTime); | |
var formatWallTime = function(wt) { | |
// Format a walltime; 4/26/2013 9:21:13 | |
return [wt.getMonth(), wt.getDate(), wt.getFullYear()].join("/") + " " + [wt.getHours(), wt.getMinutes(), wt.getSeconds()].join(":"); | |
}; |
This file contains hidden or 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.exports = function(grunt) { | |
var cfg = { | |
jshint2: { | |
options: { | |
jshint: { | |
node: true, | |
unused: true, | |
undef: true | |
} | |
}, |
This file contains hidden or 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
/* global Backbone, _, $ */ | |
Backbone.TemplateView = Backbone.View.extend({ | |
// Set this to your stache name, or a function that takes template data and returns html | |
template: null, | |
render: function () { | |
var template = this.getTemplate(); | |
// Set the html based on the template |
This file contains hidden or 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
# Description: | |
# Logs chat to Redis and displays it over HTTP | |
# | |
# Dependencies: | |
# "redis": ">=0.7.2" | |
# "moment": ">=1.7.0" | |
# | |
# Configuration: | |
# LOG_REDIS_URL: URL to Redis backend to use for logging (uses REDISTOGO_URL | |
# if unset, and localhost:6379 if that is unset. |
This file contains hidden or 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
var SocketsModel = Backbone.Model.extend({ | |
sockets: null, | |
autoListen: true, | |
// Mapping of channel to callback name (like events hash) | |
channels: function () { | |
var chans = {}; | |
chans["data"] = "onSocketData"; | |
chans["error"] = "onSocketDataError"; |
This file contains hidden or 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
var styleSheets = document.styleSheets, | |
totalRules = 0; | |
styleSheets = Array.prototype.slice.call(styleSheets, 0); | |
styleSheets.forEach(function (stylesheet) { | |
if (!stylesheet.cssRules) { | |
return; | |
} | |