This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Firstly, we can't comment inside liquid tags, so this turned into a mess pretty quickly. | |
In order to somewhat document this mess, I'll do my best without writing the comments inline :( | |
This snippet takes in a string variable called "raw", parses it for markdown, and spits out the | |
corresponding HTML representation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- this should be on codepen... lets do that instead --> | |
<svg> | |
</svg> | |
<style> | |
#test svg #anim * { | |
transition: stroke-dashoffset 1s ease; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Client wants a realistic inventory gauge displayed on the product page. | |
Limitations in Shopify are heavy, so this only works with products with a "Size" option that is formatted like {{number}}oz or {{number}}lbs | |
The idea here is to basically sum up the total number of pounds of product we have remaining, and divide that by the pre-set batch size. | |
The pre-set batch size is configured with Shopify meta tags, per-product. | |
{% endcomment %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make_wm_request: async function({method,url,http_body,vendor_id,consumer_id,consumer_pk,channel_type} = {}){ | |
return new Promise(async function(resolve,reject){ | |
//if you don't have a PEM-formatted private key (we didn't), generate one real quick | |
var pk_chunked = chunkSubstr(consumer_pk, 64).join("\n") | |
pk_chunked = "-----BEGIN PRIVATE KEY-----\n" + pk_chunked + "\n-----END PRIVATE KEY-----\n" | |
var epoch_timestamp = Date.now() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Variant_ids = [18334016901, 17782905285 ] | |
Product_ids = [5782681861, 5620148101 ] | |
Prices = [2450, 500 ] | |
Triggers = [15000, 2500 ] | |
def gwp(product_id, variant_id, product_price, activation_total) | |
should_trigger_gift = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//we couldn't find a good example of this anywhere... so here it is! | |
!(async function(){ | |
//async code here runs immediately | |
})() | |