This file contains hidden or 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
// Get all combinations of a multi-select control | |
const getAllSubsets = aPowerSet => aPowerSet.reduce( (subsets, value) => subsets.concat( subsets.map(set => [value,...set]) ), [[]] ); | |
// usage | |
getAllSubsets(["sun","mon","tue","wed","thr","fri","sat"]) |
This file contains hidden or 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
// | |
{ | |
"QQQQ-Rep-2.1-AI2": | |
[ | |
// | |
[ | |
{"name":"Gurnee, IL", | |
"id":"RVF03QQQQ", | |
"salesforceId":"AI2", | |
"startDate":"10/28/2022", |
This file contains hidden or 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
// This snippet when executed in the browser will log a valid JSON-LD FAQ rich snippet | |
// derived from the existing HTML FAQ. | |
// www.theScottKrause.com | |
const jOut = {"@context": "https://schema.org", "@type": "FAQPage","mainEntity": []} | |
const aelQs = [ ... document.querySelectorAll(".l-faq") ] | |
aelQs.forEach(function( elFAQ ){ | |
let elQ = elFAQ.querySelector("summary") | |
let elA = elFAQ.querySelector("p") | |
let oOut = {"@type": "Question", "name": "##Q##", "acceptedAnswer": {"@type": "Answer", "text": "##A##" }} |
This file contains hidden or 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
// Clear the Cache | |
caches.keys().then((keyList) => | |
Promise.all( | |
keyList.map((key) => { | |
return caches.delete(key); | |
}) | |
) | |
) |
This file contains hidden or 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
/* | |
use | |
(min-aspect-ratio: 13/9) | |
(max-aspect-ratio: 13/9) | |
instead of | |
(orientation : landscape) | |
(orientation : portrait) |
This file contains hidden or 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 testUniqueChars(text) { | |
// www.theScottKrause.com | |
const aDucks = Array.from(new Set(Array.from(text))); | |
return text.length == aDucks.length; | |
} |
This file contains hidden or 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
document.addEventListener("keyup", function( ev ){ | |
let elKey = null | |
let sKeyVal = ev.key.toLowerCase() | |
if( sKeyVal ){ | |
if( sKeyVal == "backspace" ) sKeyVal = "bs" | |
if( sKeyVal == "enter" ) sKeyVal = "cr" | |
elKey = WrdKey.getKeyEl( sKeyVal ) | |
if( elKey ){ // Simulate Tap | |
const evMD = new MouseEvent('mousedown', {view: window, bubbles: true, cancelable: true }) | |
const evMU = new MouseEvent('mouseup', {view: window, bubbles: true, cancelable: true }) |
This file contains hidden or 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
-- phpMyAdmin SQL Dump | |
-- version 4.9.7 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: localhost | |
-- Generation Time: Feb 09, 2022 at 11:40 AM | |
-- Server version: 10.3.29-MariaDB | |
-- PHP Version: 7.4.9 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
This file contains hidden or 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 simuClick = function (elem) { | |
var evt = new MouseEvent("click", { | |
bubbles: true, | |
cancelable: true, | |
view: window | |
}); | |
var canceled = !elem.dispatchEvent(evt); | |
}; |
This file contains hidden or 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 limitGraphics = (function( _d, _q ){ | |
var aImgs = _d.querySelectorAll( _q ); | |
if( aImgs.length >= 75 ) window.stop(); | |
})(document, "[src*=graphics-prod"); |