https://chrome.google.com/webstore/detail/modern-flat/pdcjjgefkpoemmlcjfcfkeminneboaob?hl=en https://chrome.google.com/webstore/detail/dark-theme/djlgdeklopcjagknhlchbdjekgpgenad?hl=en https://chrome.google.com/webstore/detail/ubuntu-black-magic-theme/nnckfbibnhikbljjnipfknnmjpafdbla?hl=en
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
_.mixin((function() { | |
function createPadding(value, pad, character) { | |
character = _.isValue(character) ? String(character) : " "; | |
var strPadded = ""; | |
var length = pad - value.length; | |
while (strPadded.length < length && character.length) { | |
strPadded += character; | |
} |
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
if (!Ember.productionMode) { | |
// relies on ember build tools which turn `Ember.assert` into a NOOP | |
Object.defineProperty(Ember, 'productionMode', { | |
value: Ember.assert && Ember.assert.length == 0 | |
}); | |
} | |
// more correct name name | |
// if (!Ember.assertionsEnabled) { | |
// // relies on ember build tools which turn `Ember.assert` into a NOOP |
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 parseUrl(url) { | |
url = String(url); | |
// expects api calls to be "/some/api/v(#)/some/path" with optional query params | |
// examples: http://regex101.com/r/vO8mU5/1 | |
var regex = /.*\/v(\d+)((?:\/\w+)+)\??(.+)?$/i; | |
var match = url.match(regex); | |
console.assert("Invalid URL '" + url + "'", match); | |
var result = { |
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 nextCssColor() { | |
function random(min, max) { | |
min = +min || 0; | |
max = +max || 0; | |
return Math.round(Math.random() * (max - min) + min); | |
} | |
var colors = [ | |
"aliceblue", | |
"antiquewhite", |
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
def message(message, tries) | |
if tries > 0 | |
puts message + " Please try again. You have #{tries} tries remaining." | |
else | |
puts "Game over! :(" | |
end | |
end | |
min = 1 | |
max = 100 |
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(Factory) { | |
function isInteger(n) { | |
return typeof n === 'number' && | |
isFinite(n) && | |
n > -9007199254740992 && | |
n < 9007199254740992 && | |
Math.floor(n) === n; | |
} | |
var SHA_CHARS = '0123456789abcdef'; |
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 clickElement = function(element) { | |
if (!element) { | |
return; | |
} | |
var event = document.createEvent('HTMLEvents'); | |
event.initEvent('click', true, true); | |
event.eventName = 'click'; | |
element.dispatchEvent(event); | |
}; |