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
Copyright (c) 2011 YOUR_NAME_HERE, YOUR_URL_HERE | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |
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
Ajax.Request.addMethods({ | |
/** | |
* Add the values given in the argument hash to an existing Ajax.Request. | |
* This method operates by extending the existing 'parameters' property | |
* on the request, then re-encoding that hash and either updating the | |
* generated URL (for GET requests) or simply setting the 'postBody' | |
* option on the request (for POST and other requests). | |
* | |
* @param parameters A hash of new parameters to extend the request with. |
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
import hashlib, base64, hmac, json, settings | |
def shopify_webhook(f): | |
""" | |
A decorator thats checks and validates a Shopify Webhook request. | |
""" | |
def _hmac_is_valid(body, secret, hmac_to_verify): | |
hash = hmac.new(body, secret, hashlib.sha256) | |
hmac_calculated = base64.b64encode(hash.digest()) |
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
import hashlib, base64, hmac | |
def get_proxy_signature(query_dict, secret): | |
""" | |
Calculate the signature of the given query dict as per Shopify's documentation for proxy requests. | |
See: http://docs.shopify.com/api/tutorials/application-proxies#security | |
""" | |
# Sort and combine query parameters into a single string. |
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
/*! Respond.js: min/max-width media query polyfill. Remote proxy (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ | |
(function(win, doc, undefined) { | |
// Add a modified version of selectivizr.js here. Could remove the methods | |
// that fetch remote stylesheets (as Respond.js would be doing that for us | |
// via the proxy method), but expose the code that parses and applies | |
// patches as a public method - something like Selectivizr.parseStyleSheets(). | |
var docElem = doc.documentElement, | |
proxyURL = doc.getElementById("respond-proxy").href, |
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
<fieldset> | |
<legend>Appearance and Fonts</legend> | |
<h3> | |
Background | |
</h3> | |
<table> | |
<tr> | |
<th> | |
<label for="background_style">Background Style</label> | |
</th> |
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
#!/usr/bin/env ruby | |
require 'yaml' | |
# Get the "type" of checkout from the arguments Git passes to us. | |
# Possible values for this are "0" for a file-only checkout (which we dont' care about) | |
# or "1" for a full branch checkout (which we do). | |
checkout_type = ARGV[2] | |
if checkout_type == "1" |
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
#!/usr/bin/env/ruby | |
require 'yaml' | |
# Get the "type" of checkout from the arguments Git passes to us. | |
# Possible values for this are "0" for a file-only checkout (which we dont' care about) | |
# or "1" for a full branch checkout (which we do). | |
checkout_type = ARGV[2] | |
if checkout_type == "1" |
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
import hashlib, base64, hmac, json, settings | |
def shopify_carrierservice_request(f): | |
""" | |
A decorator thats checks and validates a CarrierService request from Shopify. | |
""" | |
def _hmac_is_valid(body, secret, hmac_to_verify): | |
hash = hmac.new(body, secret, hashlib.sha256) | |
hmac_calculated = base64.b64encode(hash.digest()) |
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 is some example markup for using the DOM Binding feature of CartJS (http://cartjs.org). | |
It's a direct copy of the second live example code on the front page of the documentation site. | |
--> | |
<!-- Add to cart form, using Data API --> | |
<form data-cart-submit="data-cart-submit"> | |
<label>Select a Product</label> | |
<select name="id"> | |
<option value="716986707">Coat</option> |
OlderNewer