Skip to content

Instantly share code, notes, and snippets.

View macdonaldr93's full-sized avatar

Ryan Macdonald macdonaldr93

View GitHub Profile
@macdonaldr93
macdonaldr93 / collection-grid.liquid
Last active June 26, 2023 17:38
OpenTheme - A facade to bridge themes and a standard Theme API
<div class="collection-grid">
{% for product in collection.products %}
<div
class="collection-grid__item"
<!-- We to know what product we're dealing with -->
data-product-id="{{ product.id }}"
<!-- A lot of API calls need the product handle, not ID -->
data-product-handle="{{ product.handle }}"
<!-- We don't always know which variant is selected within a grid item -->
data-variant-id="{{ product.selected_or_first_available_variant }}">
@macdonaldr93
macdonaldr93 / main.ts
Created April 11, 2022 18:32
Lighthouse Labs 2022 - Challenge #1
const van_tor_price = 250;
const van_ott_price = 280;
const van_mon_price = 240;
const van_edm_price = 150;
const van_cal_price = 180;
const van_tor_travel_time = 3.5;
const van_ott_travel_time = 4;
const van_mon_travel_time = 4;
const van_edm_travel_time = 1.5;
@macdonaldr93
macdonaldr93 / capitolOneCalculateTotalAmountOnPage.js
Last active April 6, 2017 20:41
Calculate the column total on the Capitol One Transactions & Details page
/**
* Calculate the column total on the Capitol One Transactions & Details page.
*
* Usage: Paste function into console. Then, run calculateTotalAmountOnPage() in console.
*
* @author https://github.com/macdonaldr93/
* @license GNU GPLv3
*/
function calculateTotalAmountOnPage() {