Skip to content

Instantly share code, notes, and snippets.

View jaredkc's full-sized avatar

Jared Cornwall jaredkc

  • Raw Generation
  • Salt Lake City, UT
View GitHub Profile
@fabianeichinger
fabianeichinger / _htmx-ext-shopify.md
Last active July 1, 2024 11:06
htmx extension for Shopify Ajax API

htmx-ext-shopify gives you access to the Shopify Ajax API from HTML to progressively enhance your Liquid templates. It's an unofficial, experimental extension for htmx.

The extension manipulates API requests and responses in order to replace / update Liquid sections on the current page. The new HTML for sections comes from Bundled section rendering and inserted using htmx swapping and out of band swaps.

This behavior is controlled using existing and new (see below) hx-* attributes on the form triggering the request.

Current features

Update the customer's cart through the Shopify Ajax API and update the current page in response.

Installation

@kellyvaughn
kellyvaughn / graphql-using-vanilla-js.js
Last active January 11, 2022 23:12
Shopify GraphQL Storefront API using Vanilla JavaScript
// This example was used to pull in variant titles and IDs dynamically
// on a custom build of the ReCharge customer portal.
//
// Feel free to send me an email if you have any questions.
//
// Kelly Vaughn -- The Taproom Agency
// kelly@thetaproom.com
// 1. Retrieve product ID in any format
const productId = <pathToProductId>;
@LiamBailey
LiamBailey / Woocommerce Bookings Dropdown
Created March 10, 2016 18:25
Changes out the Woocommerce Bookings date picker fields for a nice dropdown showing only available dates
<?php
/*
Plugin Name: Woocommerce Bookings Dropdown
Description: Swaps the date picker for a dropdown of dates
Version: 1.0.0
Author: Webby Scots
Author URI: http://webbyscots.com/
*/
$wswp_dates_built = false;
add_filter('booking_form_fields','wswp_booking_form_fields');
@PetarIvancevic
PetarIvancevic / Shopify tag filter groups for individual collection search
Last active August 17, 2023 08:12 — forked from darryn/Shopify tag filter groups
Create tag filter groups in Shopify.This snippet is designed to group and separate out collection tags. It requires the tags to share a common value prepended to the tag with an underscore. E.g. to create a separate tag filter group for 'brands', each product will need to be tagged with 'brand_Nike' or 'brand_Reebok'.Some of this is probably lon…
@verticalgrain
verticalgrain / wp-geocode-postalcode-gravityforms.php
Last active September 4, 2017 17:55
Wordpress filter - Geocode postal code custom field to latitude and longitude custom fields - Gravity forms, regular custom fields
<?php
/**
* Geocodes a postal code field from a gravity form, saves latitude and longitude to custom fields
* To use this, change $entry[26] to the id of your gravity form field that contains the postal code - i.e. $entry[2]
* To use this, change the name of the geo_latitude and geo_longitude custom fields to what you've created.
* For bonus points, name your lat and long custom fields geo_latitude and geo_longitude, to be in line with Wordpress standard Geodata: https://codex.wordpress.org/Geodata
*
*
*/
@vitorbritto
vitorbritto / rm_mysql.md
Last active July 5, 2024 17:22
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@pmgarman
pmgarman / delete.sql
Created August 1, 2013 22:35
How to find and delete orphaned product variations from WooCommerce sites.
DELETE o FROM `wp_posts` o
LEFT OUTER JOIN `wp_posts` r
ON o.post_parent = r.ID
WHERE r.id IS null AND o.post_type = 'product_variation'
@jaredkc
jaredkc / git-cheat-sheet.md
Last active September 25, 2017 17:03
GIT Cheat Sheet

Git Cheat Sheet

Branches

Delete remote branch: git push origin :<branchName>

Add a remote branch: git remote add <remoteName> <gitAddress>