Skip to content

Instantly share code, notes, and snippets.

<!-- Before </head> tag, add -->
{{ 'sam_referral.js' | asset_url | script_tag }}
.mobile-show {
display: none;
}
@media (max-width: 640px) {
.mobile-show {
display: inline;
}
.desktop-show {
{% unless grid_item_width %}
{% assign grid_item_width = 'large--one-third medium--one-half' %}
{% endunless %}
{% include 'buyx-price-min' with product %}
{% assign on_sale = false %}
{% if product.compare_at_price > buyx_price_min %}
{% assign on_sale = true %}
<!-- /templates/product.liquid -->
{% include 'buyx-product' with product %}
{% include 'buyx-price-min' with product %}
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
after
{{item.variant.title}}
add
<span class="saso-cart-item-discount-notes" data-key="{{item.key}}"></span>
<span class="saso-cart-item-upsell-notes" data-key="{{item.key}}"></span>
==
<script data-cfasync="false" >
window.saso_config = {
upsell_variant_choose_option: "please select",
upsell_variant_choose_message: "Please select an option",
translate_percent_off: '% Off'
}
</script>
@essmahr
essmahr / s3_upload.py
Last active August 23, 2017 22:30
recursive uploading of directory to Amazon s3 with automatic MIME type detection (for static sites)
import os
import sys
import argparse
import mimetypes
import boto3
from botocore.exceptions import ClientError
def upload_to_s3(local_directory, bucket, destination):
try:
client = boto3.client('s3', config=boto3.session.Config(signature_version='s3v4'))
@essmahr
essmahr / multiline-html.md
Last active May 17, 2017 17:08
multiline HTML tags

multiline html tags, how do we write them?

Writing HTML in 2017 means writing markup with lots of data attributes, or writing vue templates or JSX, which means incorporating a LOT more HTML attributes to our tags than we once had to. Line lengths get crazy. How should our Code Guide suggest multilining HTML?

option A

First attribute same line as tag name, other attributes aligned

weird.

<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<p>A paragraph (from the Greek paragraphos, &ldquo;to write beside&rdquo; or &ldquo;written beside&rdquo;) is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. Though not required by the syntax of any language, paragraphs are usually an expected part of formal writing, used to organize longer prose.</p>
<blockquote>
<p>A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.</p>
<p>It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.</p>
@essmahr
essmahr / barberpole.scss
Last active August 29, 2015 14:21
barberpole
// you'd better have bourbon.io
$barber-color: red;
.barberpole {
background-size: 30px 30px;
@include background-image(linear-gradient( 45deg, $barber-color 25%, transparent 25%, transparent 50%, $barber-color 50%, $barber-color 75%, transparent 75%, transparent));
@include animation(barberpole 1.5s linear infinite);
}
@include keyframes(barberpole) {