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
inside template {{#items}} loop I do this: | |
<div class="grid--full display-table"> | |
<div class="grid__item"> | |
{{{retNextDiscount itemQty properties }}} | |
</div> | |
</div> | |
helper in Custom Javascript is this: |
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 %} | |
We use the content_for_header and capture it and if it contains certain JS listener for the Shopify preview bar then it will be a staff member whos logged in. | |
Please only include it once per page, as it takes a little performance hit to search the entire CFH capture. | |
Test the variable like { % if isAdmin %} and use it to re-direct or whatever you'd like. (Remove the extra space) | |
There is a default re-direct away to the homepage for these themes for now, this can be changed in a later version to be an argument. | |
- Jed V. Jan 2020 <root@livingthedream.fun> |
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
const express = require('express'); | |
const getRawBody = require('raw-body'); | |
const crypto = require('crypto'); | |
const tradeGeckoSecretKey = ''; | |
async function verifyTradeGeckoWebhook(req, body) { | |
const hmac = req.get('X-Gecko-Signature'); | |
const hash = crypto | |
.createHmac('sha256', tradeGeckoSecretKey) |
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
document.addEventListener('DOMContentLoaded', function(){ // Just make sure DOM is ready. | |
// Padding, width & height for SVG element - used to calculate everything else. | |
var padding = 40; | |
var width = 700; | |
var height = 700; | |
// Setup scales for X, Y position, colour & radius of points. | |
var yScale = d3.scaleLinear() | |
.domain(d3.extent(regionData, d => d.subscribersPer100)) | |
.range([height - padding, padding]); |