Please ensure you are familiar with our JavaScript styleguide. This guide builds on top of that document and aims to advise on the semantic naming of variable, objects, properties, classes and functions.
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
# Stop on error | |
set -e | |
# Is brew needed? | |
if [ -x "$(which brew)" ]; then | |
echo Skipping brew | |
else | |
echo Installing brew | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
fi |
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 Trello = require('node-trello') | |
, t = new Trello('KEY', 'TOKEN') | |
t.get('/1/boards/bdLKstEV', function(err, data) { | |
if (err) throw err | |
console.log('#', data.name, '\n') | |
console.log('[Source Trello Board](%s)',data.url) | |
console.log(data.desc, '\n') | |
t.get('/1/boards/bdLKstEV/lists?cards=open', function(err, data) { |
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
Table Name | Size | Index Size | Total Size | |
---------------------------------+------------+------------+------------ | |
CompetitionAnswer | 998 MB | 860 MB | 1857 MB | |
PageTracking | 273 MB | 114 MB | 387 MB | |
User | 42 MB | 29 MB | 71 MB | |
Article | 15 MB | 21 MB | 36 MB | |
Comment | 14 MB | 22 MB | 36 MB | |
PollEntry | 11 MB | 18 MB | 30 MB | |
SearchIndex | 8928 kB | 33 MB | 41 MB | |
Binary | 7512 kB | 1376 kB | 8888 kB |
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
lib/app.js: line 42, col 36, This function has too many statements. (75) (W071) | |
lib/backchannel.js: line 70, col 56, This function's cyclomatic complexity is too high. (8) (W074) | |
lib/jobs.js: line 136, col 17, This function's cyclomatic complexity is too high. (14) (W074) | |
lib/libconfig.js: line 77, col 20, This function's cyclomatic complexity is too high. (7) (W074) | |
lib/middleware.js: line 114, col 23, This function's cyclomatic complexity is too high. (7) (W074) | |
lib/middleware.js: line 220, col 67, This function's cyclomatic complexity is too high. (7) (W074) |
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
# Missing versionPath | |
# *.jade,*.html | |
## Link | |
(^|\s)link.*(href)=(?!versionPath)['"](/\w|\.+/) | |
## Meta | |
(^|\s)meta.*(content)=(?!versionPath)['"](/\w|\.+/) | |
## src - img, iframe, script |
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
// List all tasks with no labels | |
(function () { | |
if (document.location.host !== 'www.pivotaltracker.com') { | |
return alert('This should be run in a console within "www.pivotaltracker.com"') | |
} | |
var projectId = document.location.pathname.match(/\d+/)[0] | |
, teams = ['frontend', 'backend', 'creative', 'technical services'] | |
$.get('https://www.pivotaltracker.com/services/v5/projects/' + projectId + '/stories?limit=999999', function(results) { | |
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
function countLines(text) { | |
var count = 1 | |
, pos = 0 | |
, found = 0 | |
while ((found = text.indexOf('\n', pos)) !== -1) { | |
count++ | |
pos = found + 1 | |
} | |
return count | |
} |
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 _ = require('lodash') | |
module.exports = function (actual, expected, ignoreObjectLength, ignoreFunctions) { | |
/* jshint maxcomplexity: 7 */ | |
if (arguments.length < 2) { | |
throw new Error('Not enough arguments') | |
} |
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
function countLines(text) { | |
var count = 1 | |
, pos = 0 | |
, found = 0 | |
while ((found = text.indexOf('\n', pos)) !== -1) { | |
count++ | |
pos = found + 1 | |
} | |
return count | |
} |