Skip to content

Instantly share code, notes, and snippets.

@for $space from 0 through $spacing-limit {
$value: $space + rem;
}
@for $space from 0 through $spacing-limit {
}
$spacing-key: (
"top": "top",
"right": "right",
"left": "left",
"btm": "bottom",
"all": null,
"vert": null,
"horiz": null
);
products = ShopifyAPI::Product.find(:all, params: { order: 'inventory_total desc', limit: 250 })
process_products(products)
3.times do
break unless products.next_page?
products = products.fetch_next_page
process_products(products)
end
{
"products": [
{
"id": 11111,
"title": "Paprika"
},
{
"id": 12345,
"title": "Chili Powder"
},
'use strict';
var AWS = require('aws-sdk');
var sqs = new AWS.SQS();
var crypto = require('crypto');
exports.handler = (event, context, callback) => {
var client_secret = event.client_secret;
delete event.client_secret;
//calculate the hash
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "ShopifyWebhookInput",
"type": "object",
"properties": {
"header": { "type": "string" },
"body": {
"type": "string"
}
}
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "ShopifyWebhookInput",
"type": "object",
"properties": {
"header": { "type": "string" },
"body": {
"type": "string"
}
}
#set($inputRoot = $input.path('$'))
{
"X-Shopify-Shop-Domain": "$input.params().header.get('X-Shopify-Shop-Domain')",
"X-Shopify-Topic": "$input.params().header.get('X-Shopify-Topic')",
"X-Shopify-Hmac-SHA256": "$input.params().header.get('X-Shopify-Hmac-SHA256')",
"body": "$util.base64Encode($input.body)",
"queue": "$stageVariables.sqs_queue",
"client_secret": "$stageVariables.client_secret"
}