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
<title>Color Distance in CIELAB</title> | |
<div style="background:#520975; width:100px; height:100px; display:block; float:left; margin:0;">#520975<br>array color</div> | |
<div style="background:#5D0C8B; width:100px; height:100px; display:block; float:left; margin:0;">#5D0C8B<br>array color</div> | |
<div style="clear:both;background:#854B97; width:100px; height:100px; display:block; float:left; margin:0;">#854B97<br>find near for this color</div> | |
<div id="near" style="width:100px; height:100px; display:block; float:left; margin:0;"></div> | |
<script> | |
const colors = [ | |
"#B2CFAD", "#F4C6CE", "#7CADD3", "#A4C7E2", "#1BCFC9", "#F7EA5F", "#ffffff", "#520975", "#004987", "#F5E500", | |
"#FF8300", "#D8262E", "#999899", "#016836", "#005CB8", "#008995", "#D08900", "#EF8F7A", "#F0B2C9", "#EA534D", |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Test a date string - by mplungjan</title> | |
<script> | |
function isValidDateCheck(dString) { | |
var dRe = /^(\d{1,2})([\-\/])(\d{1,2})\2(\d{4}|\d{2})$/ | |
if (!dRe.exec(dString)) { |
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 elemsToKeep = [1, 3, 5, 6, 8]; | |
var arr=[]; | |
arr[0] = 'one1'; | |
arr[1] = 'two2'; // remove | |
arr[2] = 'three3'; | |
arr[3] = 'four4'; // remove | |
arr[4] = 'five5'; | |
arr[5] = 'six6'; | |
arr[6] = 'seven7'; // remove |
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
<html> | |
<head> | |
<script> | |
// using bing since google does not like being inside a jsfiddle frame | |
var myLinks = [ | |
'http://bing.com/search?q=go', | |
'http://bing.com/search?q=visit', | |
'http://bing.com/search?q=explore', | |
'http://bing.com/search?q=funny%20pics' | |
]; // note no comma on the last item |
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
//if (!window.console) window.console={ log:function(str) { alert(str) } } | |
if (!window.console) | |
window.console={ log:function() { | |
var text = []; | |
for (var a,i=0;i<arguments.length;i++) { | |
a=arguments[i]; | |
text.push(typeof a+": "+(typeof a == "object" ? a.toString():a)); | |
} | |
alert(text.join('\n')) | |
} |
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 find_unique_characters(string){ | |
unique=[]; | |
while(string.length>0){ | |
var char = string.charAt(0); | |
var re = new RegExp(char,"g"); | |
console.log(re,char,string.match(re)) | |
if (string.match(re).length===1) unique.push(char); | |
string=string.replace(re,""); | |
} | |
return unique.join(""); |