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 AppObject = Ember.Object.extend({ | |
/** | |
* Get a list of all computed properties set on this instance | |
* | |
* @method getComputedPropertyList | |
* @return {Array} List of computed properties (strings) | |
* @since TODO | |
*/ | |
getComputedPropertyList: function() { |
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
<pre> | |
<?php | |
//By @pkspencer | |
function generateNines_One($numNines) | |
{ | |
$result = 0; | |
for ($i=0; $i < $numNines; $i++) { | |
$result += pow(10, $i); | |
} |
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
local sendEscape = true | |
local ctrlKeyTimer = hs.timer.delayed.new(0.15, function() | |
sendEscape = false | |
end) | |
local lastMods = {} | |
local flagsChangedHandler = function(event) | |
local newMods = event:getFlags() | |
if lastMods.ctrl == newMods.ctrl then return false end |
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
// isCouponInCategories :: Array<Object> => Object -> Boolean | |
const isCouponInCategories = categories => coupon => | |
categories.includes(coupon.category); | |
// percentDiscount :: Object -> Number | |
const percentDiscount = coupon => | |
((coupon.couponAmount / coupon.itemPrice) * 100); | |
// TODO: I decided to remove the code after the list was reduced | |
// to the 10 coupons because of the "So in short" summary of |
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
// --- UTILS ------------------------------------------------ | |
// pipe :: ...Functions => a -> b | |
const pipe = (...funcs) => data => | |
funcs.reduce((acc, func) => func(acc), data); | |
// toNumber :: String -> Number | |
const toNumber = data => parseInt(data, 10); | |
// double :: Number -> Number |
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
// NOTE: Ramda repl | |
console.clear() | |
const foo = [ | |
{ id: 'one' }, | |
{ id: 'two' }, | |
{ id: 'three' }, | |
] |
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
// NOTE: Ramda repl | |
console.clear() | |
const foo = (a, b) => a + b | |
const bar = () => 4 | |
const tryYolo = curry((func, params) => { | |
try { | |
return apply(func, params) |
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
class ConsecutiveFailure { | |
constructor({ | |
count = 0, | |
threshold = 10, | |
logger = console.log, | |
}) { | |
this.count = count; | |
this.threshold = threshold; | |
this.logger = logger; | |
} |
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
const { log } = console; | |
console.clear(); | |
const logHof = fn => (...args) => { | |
log('logHof') | |
log(args); | |
return fn(...args); | |
}; | |
const incrementHof = fn => (x, y) => { |
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
const { log, clear } = console | |
const reduceI = addIndex(reduce); | |
const HUMAN = 'X'; | |
const COMPUTER = 'O'; | |
class Board { | |
constructor({ | |
rows = 4, |
OlderNewer