Consider a list of strings you need to permanently assign a random color.
First you should turn the string into a hash.
var string = "string"
var hash = 0
$camphor300:'d09GMgABAAAAAQ5UABIAAAAEn0QAAQ3tAAEZmQAAAAAAAAAAAAAAAAAAAAAAAAAAG4SkahzOKgZgFotgAIosCCIJgnMRCAqLlgCKvTwBNgIkA5lwE4GnDguZdAAEIAW7bwcgDHJb0WS0WUXZkokWaBHx4wKbY7TigANIU/t980QCGzI/IkCsdbqJZwY1ZOgWDngIamw3I43435Dd+zJ1kNmKVp/DvXNAwaNm//////////////////+/NZkMZ5cAl0CpbZ3oiwloFA5GyIWNzOYVLt1bpXPX+pABI2fo5rMZpgVYIzYqgxt92ajECqUKh2G9gaOCVRC23VSRVypHfbvb7wYcwEM25WArF0esm1yKzDixrJRdcBGtcpBZTFbFbIl8LIU4gWOnEdSITqkoGrHWJ8ywn9eVFWWk3lC6m07qp1TXntHaWp6ekYHLrFoyzOXYiQnn2kWX2zqMaFBTca25vHKndPhJV66HRhQzL9lB3OT20KGTXuFHu62wm1qzoV/iTnaiLdc8o/D7B+1O94BrjSE3cia6U1A5XNp0kHmUj8IMBaeiGaiNJV7b1csb0bq8EWYo2h1TuipR+7hmYjxeZsonGLNcmgsKp5EUDCEj9SvRyxX2uMUNfINmfNqglBYNNtjtNmdwWV2ly4uQKheyDyka2RTRoQ3IEfs+0BNcGJ4Z5AnmHNpFbCKW5PsXkAzJ6VVzzVMo0fwIUpQQT67itTNRE946/NxDashl9KuAFUbZ6yW91vObh+WAMZ1mQ1J4wotF6KXHuo65X6wSz406hW/T6XZMf/6W+HGYUxCDfhyjPaoMGcWccmbYM/H35NdHTOd79Jg0ho/BDBvRy2vcg8pHsv07UYiKrDFeqzL0Qk7qCkXLuukl2EKuR3xS6VtsLEaT0BfWoDYoQ1YvEjjT729XNMYoCX3j+2ApedBG/UHLOJ7AAnfPSqdmmePsY+522MpfPaf7kf6fIJMn0/4SE6PmuI3yjyeGjWn+1qj/ukf09DE |
var bittrex = require('./node.bittrex.api.js'); | |
bittrex.options({ | |
'apikey': '', | |
'apisecret': '', | |
'stream': false, | |
'verbose': false, | |
'cleartext': false | |
}); |
function digestBomb() { | |
var $rootScope = angular.injector(['ng']).get('$rootScope'); | |
function $digest() { | |
$rootScope.$$postDigest($digest); | |
$rootScope.$digest(); | |
} | |
$digest(); | |
} |
/* $ gcc cve_2016_0728.c -o cve_2016_0728 -lkeyutils -Wall */ | |
/* $ ./cve_2016_072 PP_KEY */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <keyutils.h> | |
#include <unistd.h> | |
#include <time.h> |
This is started out as a curiosity, pasted as a gist but now, years later, I've come back to it because there are too many of these uuid modules out there and they're too complicated.
This, however, is easy to read and understand (for me, at least). Even its tests are dependncy and build-step free.
node-uuid vs crazy-uuid vs fast-uuid
// Version without jQuery | |
javascript:(function () { var root = angular.element(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) { if (element.data() && element.data().hasOwnProperty(scopeProperty)) { angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) { watchers.push(watcher); }); } }); angular.forEach(element.children(), function (childElement) { f(angular.element(childElement)); }); }; f(root); var watchersWithoutDuplicates = []; angular.forEach(watchers, function(item) { if(watchersWithoutDuplicates.indexOf(item) < 0) { watchersWithoutDuplicates.push(item); } }); console.log(watchersWithoutDuplicates.length); })(); | |
// Version with jQuery | |
javascript:(function () { var root = $(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watche |
---------- Usage | |
The syntax created by these parameters is placed in an alert's description on TradingView | |
to be utilized by Autoview, a Chrome Extension. | |
Autoview: https://chrome.google.com/webstore/detail/autoview/okdhadoplaoehmeldlpakhpekjcpljmb | |
> Website: https://autoview.with.pink | |
> Help: https://use.autoview.with.pink | |
> Discord: https://discordapp.com/invite/BFz8VPn | |
TradingView: https://tradingview.go2cloud.org/aff_c?offer_id=2&aff_id=1187 |
{ | |
"require": { | |
"khr/react-curl": "~2.0", | |
"sunra/php-simple-html-dom-parser": "~1.5" | |
} | |
} |
var sum = values.reduce(function(sum, value){ | |
return sum + value; | |
}, 0); | |
var avg = sum / data.length; |