Skip to content

Instantly share code, notes, and snippets.

@tbuchok
tbuchok / scrape-cio.js
Last active November 9, 2015 16:46 — forked from carlsednaoui/scrape-cio.js
Get stats from Customer.io
// doesn't work yet :)
var selectors = [
'.name',
'.created',
'td p:first-child',
'.updated',
'.unsent',
'.sent',
'.opened',
'.clicked',
@tbuchok
tbuchok / coderbyte.js
Last active January 3, 2016 15:39 — forked from robpe/coderbyte.js
function fn(array) {
return array
.sort(function(a,b) { return a - b })
.reduce(function(sum, val, idx, sorted) {
// this still has holes in it, not testing correct things:
return (idx == sorted.length - 1) ? sum > sorted[idx] : sum + val;
}, 0);
}
console.log('[4, 6, 23, 10, 1, 3]', fn([4, 6, 23, 10, 1, 3])); //=> true