Skip to content

Instantly share code, notes, and snippets.

@davidwarrington
davidwarrington / submit-form.js
Last active August 21, 2023 01:46
Submit a form with JS
/** @param {HTMLFormElement} form */
async function submitForm(form) {
const body = new FormData(body)
return fetch(form.action, {
method: form.method,
body,
})
}
@davidwarrington
davidwarrington / liquid.json
Last active June 7, 2022 17:42
Shopify User Snippets
"Schema, link": {
"prefix": "schema: link",
"body": [
"{",
"\t\"label\": \"${1:Link Text}\",",
"\t\"id\": \"${2:link_text}\",",
"\t\"type\": \"text\"",
"},",
"{",
"\t\"label\": \"${3:Link URL}\",",