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
colortest() { | |
echo "$(tput setaf 1)1 $(tput setaf 2)2 $(tput setaf 3)3 $(tput setaf 4)4 $(tput setaf 5)5 $(tput setaf 6)6 $(tput setaf 7)7 $(tput setaf 8)8 $(tput setaf 9)9 $(tput setaf 10)10 $(tput setaf 11)11 $(tput setaf 12)12 $(tput setaf 13)13 $(tput setaf 14)14 $(tput setaf 15)15 $(tput setaf 16)16 $(tput sgr0)" | |
local FCR=$(tput setaf 1) | |
local FCG=$(tput setaf 2) | |
local FCY=$(tput setaf 3) | |
local FCB=$(tput setaf 4) | |
local FCM=$(tput setaf 5) | |
local FCC=$(tput setaf 6) | |
local FCW=$(tput setaf 7) | |
local FCK=$(tput setaf 8) |
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
Array.prototype.unique = function() { return this.filter(function(val, idx) { return this.indexOf(val) === idx; }, this); }; | |
Array.prototype.union = function(that) { return this.concat(that).unique(); }; | |
Array.prototype.intersection = function(that) { return this.filter(function(val) { return that.indexOf(val) !== -1; }).unique(); }; | |
Array.prototype.difference = function(that) { return this.filter(function(val) { return that.indexOf(val) === -1; }).unique(); }; |
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
function waitUntil(condition, delay, maxAttempts, onSuccess, onFail) { | |
console.debug(`- - - waitUntil to run ${onSuccess.name} - trying ${condition.name} up to ${maxAttempts} times over up to ${delay * maxAttempts}ms`); | |
let attempts = 0; | |
function attempt() { | |
setTimeout(function() { | |
attempts++; | |
console.debug(`- - - - Attempting ${condition.name} to run ${onSuccess.name} (attempt ${attempts} of ${maxAttempts})...`); | |
if (condition()) { | |
let result = onSuccess(); | |
console.debug(`- - - - - Success: ${onSuccess.name} returned ${result} after ${attempts * delay}ms`); |
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
Stalking my profile is a valid solution. | |
bA7q50lYryz3IE0i |