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
Show hidden characters
{ | |
// Synced with https://github.com/jshint/jshint/blob/master/examples/.jshintrc | |
// comments/etc retained to enable diff'ing | |
// Detailed explanation of options: | |
// - http://www.jshint.com/docs/options/ | |
"maxerr" : 10000, // {int} Maximum error before stopping | |
// Enforcing | |
"bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.) |
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 fakeServer(method, url, response) { | |
response = response || { | |
"data": "default" | |
}; | |
var server = sinon.fakeServer.create(), | |
// force a server pass through to enable response delays | |
forceServer = sinon.stub(App, "isApiEndpoint").returns(false), | |
// ic.ajax will always do an internal lookup before passing it on |
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
windows: | |
todo = "!f() { git diff $1 -STODO | grep -E '\\+\\+\\+|TODO' | sed 's/+++ b\\//\\n/' | sed 's/\\+\\s*\\/\\// */'; }; f" | |
unix: | |
todo = "!f() { git diff $1 -STODO | grep -E '\+\+\+|TODO' | sed 's/+++ b\//\n/' | sed 's/+\s*\/\// */'; }; f" |
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 woot = document.querySelector('#woot'); | |
var song = document.querySelector('#now-playing-media'); | |
var date = function () { | |
return new Date().toLocaleString().replace(',', ''); | |
}; | |
var observer = new MutationObserver(function(mutation) { | |
var wootable = woot.querySelector('.icon-woot'); | |
if (wootable) { | |
console.log('autowoot @ %s: %s', date(), song.innerText); |
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 pad(n, count) { | |
// http://stackoverflow.com/a/15398371 | |
var length = (Math.log(Math.abs(n + 1)) * 0.43429448190325176 | 0) + 1; | |
count = Math.max(count - length, 0); | |
if (n < 10) { | |
return n; | |
} | |
// http://stackoverflow.com/a/5450113 |
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 util = require('util'); | |
var chalk = require('chalk'); | |
var LOG_TYPE = chalk.bold.black('[') + '%s' + chalk.bold.black(']') + ':'; | |
var ALL = { | |
type: 'ALL' | |
}; | |
var TRACE = { | |
type: 'TRACE', | |
fn: console.log, |
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() { | |
if (!/youtube.com$/i.test(location.host)) { | |
alert("hostname does not match 'youtube.com'"); | |
return; | |
} | |
var timeout; | |
var resume; | |
var repeat = function repeat() { | |
clearTimeout(timeout); |
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
describe('filterObject', function () { | |
it('should filter out falsey values', function () { | |
var actual = filterObject({ | |
empty: '', | |
depth: 0, | |
nested: { | |
empty: '', | |
depth: 1, | |
nested: { | |
empty: '', |
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(History) { | |
if (!Ember.Object.detectInstance(History)) { | |
throw new Error("Native `Ember.History` is already defined."); | |
} | |
if (Ember.Evented.detect(History)) { | |
return; | |
} else { | |
History.reopen(Ember.Evented); | |
} |
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
/** | |
* Command Dispatcher for managing {@code App.Command}. | |
* | |
* {@link http://en.wikipedia.org/wiki/Command_pattern|Command Pattern} | |
*/ | |
App.CommandController = Ember.Controller.extend({ | |
commands: null, | |
result: null, | |
position: 0, | |
maxRedo: 0, |