Skip to content

Instantly share code, notes, and snippets.

@sadiesaurus
sadiesaurus / 0_reuse_code.js
Created September 20, 2016 23:38
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sadiesaurus
sadiesaurus / back-to-the-top.html
Last active October 12, 2020 11:55 — forked from carolineschnapp/new_gist_file.html
Back to the top snippet
View back-to-the-top.html
{% comment %}
Reduce below value if you need the back to the top button to appear higher up on the page.
That value is in pixels.
{% endcomment %}
{% assign vertical_offset_for_trigger = 300 %}
{% comment %}
Vertical offset from bottom of browser for the position of the button.
{% endcomment %}
{% assign position_from_bottom = '4em' %}
<a href="#" title="Back to the top" class="back-to-top">
@sadiesaurus
sadiesaurus / currencies.liquid
Last active November 9, 2017 15:55 — forked from carolineschnapp/currencies.liquid
currencies.liquid
View currencies.liquid
{% if settings.show_multiple_currencies %}
{{ "//cdn.shopify.com/s/javascripts/currencies.js" | script_tag }}
<script>
window.onload = function() {
Currency.format = '{{ settings.currency_format | default: 'money_with_currency_format' }}';
var shopCurrency = '{{ shop.currency }}';
/* Sometimes merchants change their shop currency, let's tell our JavaScript file */
Currency.moneyFormats[shopCurrency].money_with_currency_format = {{ shop.money_with_currency_format | strip_html | json }};
@sadiesaurus
sadiesaurus / currency-picker.liquid
Last active April 26, 2017 18:44
Currency picker button, to toggle between two currencies
View currency-picker.liquid
<span id="currencies">
<span data-currency="{{ settings.default_currency }}" class="left">{{ settings.default_currency }}</span>
<span data-currency="{{ settings.second_currency }}" class="right">{{ settings.second_currency }}</span>
</span>
<style>
#currencies {
display: -moz-inline-stack;
display: inline-block;
zoom: 1;
@sadiesaurus
sadiesaurus / jquery.currencies.min.js
Created May 1, 2017 17:16
jquery.currencies.min.js
View jquery.currencies.min.js
/*
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
*/
@sadiesaurus
sadiesaurus / related-products.liquid
Created May 8, 2017 20:28
related-products.liquid for non-sectioned Venture
View related-products.liquid
@sadiesaurus
sadiesaurus / related-products.liquid
Created May 9, 2017 12:39
related-products.liquid for Debut
View related-products.liquid
@sadiesaurus
sadiesaurus / related-products.liquid
Last active October 26, 2017 20:27
related-products.liquid for sectioned Venture
View related-products.liquid
@sadiesaurus
sadiesaurus / related-products.liquid
Created May 9, 2017 12:43
related-products.liquid for sectioned themes
View related-products.liquid
@sadiesaurus
sadiesaurus / shipping-calculator
Created June 14, 2017 21:27
sectioned themes shipping calculator snippet
View shipping-calculator
{% unless settings.shipping_calculator == 'Disabled' %}
<div id="shipping-calculator">
<h3>{{ settings.shipping_calculator_heading | default: 'Get shipping estimates' }}</h3>
<div>
<p class="field">
<label for="address_country">Country</label>
<select id="address_country" name="address[country]" data-default="{% if shop.customer_accounts_enabled and customer %}{{ customer.default_address.country }}{% elsif settings.shipping_calculator_default_country != '' %}{{ settings.shipping_calculator_default_country }}{% endif %}">{{ country_option_tags }}</select>
</p>
<p class="field" id="address_province_container" style="display:none;">
<label for="address_province" id="address_province_label">Province</label>