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
| 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
| 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
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 orderByProperty(prop) { | |
| var args = [].slice.call(arguments, 1); | |
| return function (a, b) { | |
| var propA = a[prop]; | |
| var propB = b[prop]; | |
| var result; | |
| if (typeof propA == 'string' || typeof propB == 'string') { | |
| result = String(propA).localeCompare(propB); | |
| } else { |
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 humanizeBytes(bytes, si) { | |
| unit = si ? 1e3 : 1024; | |
| var byteSuffix = (si ? 'b' : 'B'); | |
| if (bytes < unit) { | |
| return bytes + byteSuffix; | |
| } | |
| var modifier = Math.floor(Math.log(bytes) / Math.log(unit)); | |
| var prefix = (si ? 'kMGTPEZ' : 'KMGTPEZ')[modifier - 1]; | |
| if (!si) { |
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 demethodize(fn) { | |
| if (typeof fn === "function") { | |
| return Function.bind.bind(Function.call)(fn); | |
| } | |
| return null; | |
| } | |
| _.mixin((function() { | |
| return { | |
| demethodize: function(fn) { |
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(I18n) { | |
| if (!I18n) { | |
| throw new Error('Missing dependency: I18n'); | |
| } | |
| var translate = I18n.translate; | |
| var slice = [].slice; | |
| /** | |
| * // en.js |
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
| Object.prototype[Symbol.iterator] = function() { | |
| let self = this; | |
| let keys = null; | |
| let length = 0; | |
| let index = -1; | |
| return { | |
| next() { | |
| if (keys === null) { | |
| keys = Object.keys(self); |
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
| /** | |
| * Inline Edit Component | |
| * | |
| * @author lamchau | |
| */ | |
| import Ember from "ember"; | |
| import KeyCodes from "utils/key-codes"; | |
| const DOUBLE_CLICK_COUNT = 2; | |
| const SINGLE_CLICK_COUNT = 1; |