Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
- Make sure your
Local by FlyWheel
WordPress install is a custom install
Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User →
Local by FlyWheel
WordPress install is a custom install/** | |
* useScroll React custom hook | |
* Usage: | |
* const { scrollX, scrollY, scrollDirection } = useScroll(); | |
*/ | |
import { useState, useEffect } from "react"; | |
export function useScroll() { | |
const [lastScrollTop, setLastScrollTop] = useState(0); |
{ | |
// Set your VSCode Workspace root to the root folder of your Local site. | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Listen for XDebug", | |
"type": "php", |
# put this in your .zshrc file, change path to store zip, restart terminal | |
# run command `releasezip my-files-1.0`, which would create a zip at ../my-files-1.0.zip | |
# change output path (../) to whatever you want, for example Users/Me/Plugins/Releases/$1.zip | |
releasezip() { | |
zip -r ../$1.zip . -x '*.git*' --exclude=\*.DS_Store\* | |
open ../ | |
} |
admin/settings/files
pageconsole_download_list.js
file, and press enterconst fetch = require('node-fetch'); | |
try { | |
// Specify the name of the template the app will integrate with | |
const APP_BLOCK_TEMPLATES = ['product', 'collection']; | |
const getOptions = { method: 'GET', headers: { 'X-Shopify-Access-Token': accessToken } }; | |
// Get published theme | |
const themeResponse = await fetch(`https://${shop}/admin/api/${API_VERSION}/themes.json`, getOptions); | |
this.checkError(themeResponse, 'ThemeFetchFailure'); |
function regReplaceWithComponent( | |
text: string, | |
exp: RegExp, | |
fn: (match: string, index: number) => JSXElement | |
) { | |
const matches = Array.from(text.matchAll(exp)); | |
const items: JSXElement[] = []; | |
for (let index = 0; index < matches.length; index++) { | |
const match = matches[index]; |