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
postsByTag: function (tagId) { | |
return dataProvider.Tag.findOne({id: tagId}).then(function (found) { | |
if (!found) { | |
return when.resolve([]); | |
} | |
// TODO: Trim data sent back | |
return when.resolve(found.related("posts")); | |
}); | |
} |
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
var fs = require('fs'), | |
path = require('path'), | |
_ = require('underscore'), | |
when = require('when'), | |
express = require('express'), | |
GhostPlugin = require('../../../core/server/plugins/GhostPlugin'), | |
knex = require('../../../core/server/models/base').Knex, | |
KudosPlugin; | |
KudosPlugin = function (ghost) { |
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
if (!process.env.NODE_ENV) { | |
console.log("Please explicitly set your node environment before running this command: > NODE_ENV=production node exporter.js"); | |
return; | |
} | |
var fs = require('fs'), | |
path = require('path'), | |
_ = require('underscore'), |
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
var styleSheets = document.styleSheets, | |
totalRules = 0; | |
styleSheets = Array.prototype.slice.call(styleSheets, 0); | |
styleSheets.forEach(function (stylesheet) { | |
if (!stylesheet.cssRules) { | |
return; | |
} | |
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
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 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 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 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 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 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. |