Skip to content

Instantly share code, notes, and snippets.

View fabianeichinger's full-sized avatar

Fabian Eichinger fabianeichinger

  • Munich, Germany
View GitHub Profile
@diegovelasquezweb
diegovelasquezweb / _htmx-ext-shopify.md
Created August 12, 2023 01:38 — forked from fabianeichinger/_htmx-ext-shopify.md
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

@petemcw
petemcw / brew-instructions.sh
Last active March 27, 2024 15:59
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.test domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache