Skip to content

Instantly share code, notes, and snippets.

View dav11d's full-sized avatar

David dav11d

  • UK
View GitHub Profile
@aarondfrancis
aarondfrancis / audit-your-codebase.md
Created August 14, 2026 15:20
A read-only, agent-orchestrated codebase audit prompt for data structures, state modeling, algorithms, and ownership.

Audit this entire codebase for materially useful simplifications in its data structures, state representation, control flow, algorithms, and ownership.

This is an audit-only exercise. Do not edit files, run tests, implement recommendations, commit, or push. Read-only inspection commands are allowed.

You are the coordinator. Continue until the complete codebase has been reviewed and the final audit is validated.

  1. Establish the coverage contract

Inspect the repository and inventory every identifiable subsystem.

const sanityClient = require('@sanity/client');
const crypto = require('crypto');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
SHOPIFY_SECRET
} = process.env;
@dturton
dturton / gift-modal.md
Created May 12, 2018 13:55 — forked from jgodson/gift-modal.md
Free Gift Modal for Shopify Themes

How to install

  1. Copy the following code and paste it at the end of config/settings_schema.json, just after the last }. Then save the file.
,
  {
    "name": "Free Gift Offer",
    "settings": [
      {
        "type": "header",
        "content": "Offer a free gift with discount code on cart page"
@gregnb
gregnb / css-fadeup.html
Created June 12, 2017 21:37
CSS stagger fade up animation
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS Staggered fade up effect</title>
</head>
<script type="application/javascript">
</script>
@elmahdim
elmahdim / toggleClass.js
Created December 30, 2015 13:51
vanilla javascript toggleClass
function toggleClass(element, className) {
if (!element || !className) { return; }
var classString = element.className, nameIndex = classString.indexOf(className);
if (nameIndex == -1) {
classString += (classString.length) ? ' ' + className : className;
} else {
classString = classString.replace(' '+className, '');
classString = classString.replace(className, '');
}
element.className = classString;
@carolineschnapp
carolineschnapp / instructions.md
Last active December 5, 2025 08:54
Handpick your relevant collection for related products using the Custom Fields extension by freakdesign. #metafields
@paulirish
paulirish / bling.js
Last active May 2, 2026 11:52
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@schmoove
schmoove / jquery.shopify-ajax-cart.js
Last active February 10, 2025 17:29
A handy jQuery plugin for updating the Shopify Cart via their AJAX API
/*
* Project: Shopify AJAX Cart Plugin
* Description: Provides AJAX cart functionality for interacting with the Shopify AJAX API so you don't need an "Update Cart" button
* Dependency: jQuery 1.6+
* Author: Ryan Marshall (ryan@schmoove.co.nz)
* License: Free
* Usage:
*
* $('#cart-form').shopifyAJAXCart({
* item: '.line-item-container',