Skip to content

Instantly share code, notes, and snippets.

View joshuaiz's full-sized avatar
💭
it iz what it iz

Joshua Michaels joshuaiz

💭
it iz what it iz
View GitHub Profile
@ahmadawais
ahmadawais / flywheel-local-xdebug-vscode.md
Last active June 3, 2024 13:28
Debug WordPress with Visual Studio Code | VSCode WordPress Debug Setup | WordPress xDebug Setup for Local by FlyWheel with VSCode | Part of the VSCode Learning Course → https://VSCode.pro

VSCode WordPress Debugging Setup: WordPress Xdebug Setup for Local by FlyWheel with VSCode


Consider supporting my work by purchasing the course this tutorial is a part of i.e. VSCode Power User

🚅 TL;DR

  • Make sure your Local by FlyWheel WordPress install is a custom install
@joshuacerbito
joshuacerbito / useScroll.js
Last active January 8, 2024 13:44
Custom React hook for listening to scroll events
/**
* useScroll React custom hook
* Usage:
* const { scrollX, scrollY, scrollDirection } = useScroll();
*/
import { useState, useEffect } from "react";
export function useScroll() {
const [lastScrollTop, setLastScrollTop] = useState(0);
@jayhill90
jayhill90 / launch.json
Created April 17, 2020 17:34
XDebug Configuration file for VSCode and Local by Flywheel
{
// 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",
@scottopolis
scottopolis / zip-clean-alias.sh
Last active May 28, 2020 20:27
ZSH alias to zip current folder, remove git and DS Store files, and show in finder
# 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 ../
}
@lexthor
lexthor / Download-Shopify-CDN-Assets.md
Last active May 6, 2024 10:58 — forked from ridem/Download-Shopify-CDN-Assets.md
Download all Shopify CDN assets from a store

Instructions

  1. Go to your Shopify admin/settings/files page
  2. Open your browser Dev tools, go to the console
  3. Paste the content of the console_download_list.js file, and press enter
  4. Your browser will automatically fetch each page and download the list with the links of all the files on the CDN.
  5. Using your preffered code editor, edit the HTML file by adding each link in img tag.
  6. Open the HTML file you just edit in a browser then right click-save as. It will download the HTML file again along with all the images in the location you specify.
@jeffquach
jeffquach / Shopify verify theme support
Last active January 3, 2023 00:30
Sample code: https://shopify.dev/apps/online-store/verify-support contains bugs. The code should be checking `templateJSONFiles.length > 0` but doesn't. The gist also doesn't not use Shopify's node library and HTTP requests are made to Shopify's REST API using node-fetch, but any HTTP library can be used instead
const 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];