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
<script> | |
function beforePost(){ | |
window.params.forEach(function (param) { | |
formData[param.key]= param.val; | |
}); | |
}; | |
</script> |
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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
*/ | |
contract Storage { | |
uint256 number; | |
/** | |
* @dev Store value in variable |
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
<a href="https://stephanestorm.groovepages.com/ouvrezuncomptegratuit" | |
class="link relative button-reset pa3 db tc ba b--transparent bg-animate pointer w-100 br2 fw8" | |
target="_blank"> | |
Plateforme Marketing Digitale | |
</a> |
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
<details class="pv1 ph2 ph4-ns mw6 center cf tc"> | |
<summary class="bg-blue link relative button-reset pv3 white db tc ba b--transparent bg-animate pointer w-100 br2 fw8"> | |
Details | |
</summary> | |
<ul class="list pl0 ml0 center mw6 ba b--light-silver br3"> | |
<li class="ph3 pv2 bb b--light-silver"> | |
<a href="#">Top Option</a> | |
</li> | |
<li class="ph3 pv2 bb b--light-silver"> | |
<a href="#">Middle Option(s)</a> |
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
//pseudocode, a mix of frontend + backend javascript: | |
//step1 (frontend): | |
const checkout = async () => { | |
try { | |
let resp = await fetch(`/api/checkout`, { | |
method: "POST", | |
headers: { | |
"content-type": "application/json", | |
}, |
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
import { timestamp, build, files } from '$service-worker'; | |
const name = `cache-${timestamp}`; | |
self.addEventListener('install', (event) => { | |
event.waitUntil(caches.open(name).then((cache) => cache.addAll(['/', ...build, ...files]))); | |
}); | |
self.addEventListener('activate', (event) => { | |
event.waitUntil( |
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 personModel = [ | |
{ label: "First", value: "first" }, | |
{ label: "Last", value: "last" }, | |
{ label: "Address1", value: "address1" }, | |
{ label: "Address2", value: "address2" }, | |
{ label: "City", value: "city" }, | |
{ label: "State", value: "state" }, | |
{ label: "Zip", value: "zip" }, | |
{ label: "Zip4", value: "zip4" }, |
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
<script async | |
src="https://maps.googleapis.com/maps/api/js?key=***YOURAPIKEY***&libraries=places&callback=initMap"> | |
</script> | |
<script> | |
window.initMap= function(){ | |
const input = document.querySelector('input[name="address"]'); | |
const options = { | |
componentRestrictions: { country: "us" }, | |
fields: ["address_components", "geometry", "icon", "name"], | |
types: ["establishment"], |
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://developer.mozilla.org/en-US/docs/Web/HTTP/CSP | |
// https://scotthelme.co.uk/content-security-policy-an-introduction/ | |
// scanner: https://securityheaders.com/ | |
const rootDomain = `your-domain.com`; // or your server IP for dev | |
const directives = { | |
'img-src': [ | |
"*", | |
"'self'", |