Skip to content

Instantly share code, notes, and snippets.

View peterberwind's full-sized avatar

Peterberwind peterberwind

View GitHub Profile
@mlocher
mlocher / codeship-to-shopify-theme-deploy
Last active June 21, 2018 16:25 — forked from hughker/codeship-to-shopify-theme-deploy.sh
Deploy a Shopify theme from Codeship
gem install shopify_theme
theme configure SHOPIFY_API_KEY SHOPIFY_API_PASSWORD SHOPIFY_STORE_URL SHOPIFY_THEME_ID
git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $COMMIT_ID | xargs theme upload
git diff-tree -r --no-commit-id --name-only --diff-filter=D $COMMIT_ID | xargs theme remove
@maxivak
maxivak / Spree: Filter by brand.md
Last active March 16, 2021 01:31
Spree: Filter Products by properties

Fix 'scoped' error for Rails 4

error: undefined method 'scoped' solution:

# config/initializers/scoped.rb
class ActiveRecord::Base
  # do things the modern way and silence Rails 4 deprecation warnings
 def self.scoped(options=nil)

options ? where(nil).apply_finder_options(options, true) : where(nil)

@cshold
cshold / shop.js
Created August 15, 2014 19:58
Shopify Ajax Cart Callback
// Create a global function that handles all cart-related JS
initCart = function (obj) {
// Do all cart things here
// If running as the ajax cart callback, an object is returned
if (obj.is_visible) {
// the cart is shown
} else {
// the cart was hidden
}
@sskylar
sskylar / index.html
Last active August 28, 2018 18:28
Simple password protection using a md5 hashed slug in Siteleaf (note: this is not intended for high security, only to stop casual visitors)
<form>
<input id="password" type="password"/>
<button>Submit</button>
</form>