Skip to content

Instantly share code, notes, and snippets.

View arianf's full-sized avatar

Arian Faurtosh arianf

View GitHub Profile
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
_.sortedIndex = function(array, obj, iteratee, context) {
iteratee = cb(iteratee, context, 1);
var value = iteratee(obj) === undefined ? Infinity : iteratee(obj);
var low = 0, high = array.length;
while (low < high) {
var mid = Math.floor((low + high) / 2);
if (iteratee(array[mid]) <= value) low = mid + 1; else high = mid;
}
return low;
};