This file contains hidden or 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
var formElement = document.getElementById("cart-form"); | |
var formAction = "/cart"; | |
var formMethod = "POST"; | |
var formData = new FormData(formElement); | |
var file = load_your_file_here; | |
formData.append('properties[file]', file); | |
var xhr = new XMLHttpRequest(); |
This file contains hidden or 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'll use the Ruby library provided by Shopify. You can install this as a gem. | |
# More info on: https://github.com/shopify/shopify_api | |
require "shopify_api" | |
# Next we need some authentication to be able to access our Shop. Lets use a private App for the moment: | |
# 1. follow the instructions on http://docs.shopify.com/api/tutorials/creating-a-private-app to create one, | |
# 2. insert the API-KEY and PASSWORD in the url below, | |
# 3. also change MY-SHOP into your shops subdomain. | |
ShopifyAPI::Base.site = "https://API-KEY:[email protected]/admin" |
This file contains hidden or 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
require 'rubygems' | |
require "aws-sdk" | |
module AWS | |
class S3 | |
# Client class for Amazon Simple Storage Service (S3). | |
class Client < Core::Client | |
# @overload set_bucket_website(options = {}) |
This file contains hidden or 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
# config/environment.rb | |
require "open-uri" | |
config.gem "nokogiri" | |
# app/models/your_model.rb | |
# Expects postal_code, street and city to be part of your model: | |
# Address.postal_code = "1222 AX" | |
# Address.street = "Erfgooiersstraat" | |
# Address.city = "Hilversum |