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
// throttle a function with requestanimationFrame | |
// throttledFunction = throttleAnimationFrame(func, immediate=false) | |
// which problem is solved? If you have a frequent event source you need to react | |
// to with a possible rerender of view components, then the function need to be executed | |
// with the next render frame but no more than once per render frame to save cpu cycles | |
// example: | |
// document.addEventListener('scroll',throttleAnimationFrame(eventHandler)) // will trigger at most once every render frame | |
var throttleAnimationFrame = (function(){ | |
var stack=new Map(); | |
var called=new Map(); |
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
// Execute a function as soon as the website has loaded | |
// compatibility: ES3 | |
function loadScript(script) { | |
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len;_key++) { | |
args[_key - 1] = arguments[_key]; | |
} | |
if (document.readyState === "complete" || document.readyState === "interactive") { | |
script.apply(void 0, args); | |
} else { | |
document.addEventListener("DOMContentLoaded",script.bind.apply(script, [this].concat(args))); |
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
// https://github.com/necolas/normalize.css/blob/master/normalize.css | |
// https://github.com/sindresorhus/modern-normalize/blob/main/modern-normalize.css | |
// https://meyerweb.com/eric/tools/css/reset/ | |
// https://gist.github.com/marharyta/b83a3683085eb42867bbcefb34687af8 // Reboot css | |
// https://elad.medium.com/normalize-css-or-css-reset-9d75175c5d1e // typography | |
*,::before,::after{box-sizing:border-box} | |
html{line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent;-moz-tab-size:4;tab-size:4;font-size:16px} | |
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Roboto','Oxygen','Ubuntu','Fira Sans','Droid Sans','Helvetica Neue',sans-serif;font-weight:400;font-size:1rem;text-align:left;background-color:#fff} | |
[tabindex="-1"]:focus{outline:none!important} | |
h1{font-size:2rem} |
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
Maca 500mg | 3g | |
Horny Goat Weed 500mg | |
Fenugreek | Bockshornklee 500mg | 350mg | |
Korean Ginseng 100mg | |
Ginkgo Bilboa 120mg | |
Tribulus Terrestris 750mg | |
Ashwaganda 300mg | |
Grünteeextrakt 250mg | |
(Rhodiola Rosea) 250mg | |
(Chinese astragalus root) |
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 getUrlQueryParams(url){ | |
return Object.fromEntries((new URLSearchParams(new URL(url).search))); | |
} |
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 csvToJson(csv){ | |
var delimiterRow = /\n/; | |
var delimiterCol = ','; | |
var rows=csv.split(delimiterRow).map(e=>e.trim()).filter(e=>e!==''); | |
var res=[]; | |
var names=[]; | |
for(var name of rows[0].split(delimiterCol).map(e=>e.trim())) names.push(name); | |
for(var i=1;i<rows.length;i++){ | |
var obj={} | |
var values = rows[i].split(delimiterCol).map(e=>e.trim()) |
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
// Primitives, Date, RegExp, Functions, all Arrays, Object, Object with null Prototype, all Errors, circular Objects, Map, Set, Fuction Arguments | |
// ToDo: self referencing structures are not correcly handled (in certain cases non-self referencing structures are falsely labeled), but they never fail to stringify | |
// Notes: https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript/53263848#53263848 | |
var objectHash = (function(){ | |
var primitiveTypes = new Set(); | |
primitiveTypes.add('Date'); | |
primitiveTypes.add('RegExp'); | |
primitiveTypes.add('Number'); | |
primitiveTypes.add('String'); | |
primitiveTypes.add('Boolean'); |
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
{{template config_path="design/email/header_template"}} | |
<table> | |
<tr class="email-intro"> | |
<td> | |
<p class="greeting">{{trans "%customer_name," customer_name=$order_data.customer_name}}</p> | |
<p> | |
{{trans "Thank you for your order from %store_name." store_name=$store.frontend_name}} | |
{{trans "Once your package ships we will send you a tracking number."}} | |
{{trans 'You can check the status of your order by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}} |
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
Quantum Safe Algorithms: | |
https://openquantumsafe.org/liboqs/algorithms/ | |
Quantum Safe openssl implementation (Open Quantum Safe): | |
https://github.com/open-quantum-safe/openssl | |
Note: Combination of classical and quantum algorithms via <classical_tag>_<quantum_tag> possible. | |
Open Quantum Safe examples for popular applications: | |
https://github.com/open-quantum-safe/oqs-demos | |
Signature schemes: |
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
const mailRegex = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/gi | |
function getValidMails(str){ | |
return Array.from(str.matchAll(mailRegex)) | |
} | |
function containsValidEmail(str){ | |
return getValidMails(str).length>0 | |
} | |
function isValidEmail(str){ | |
let mail = str.match(mailRegex); | |
return mail && mail[0].length === str.length; |