Skip to content

Instantly share code, notes, and snippets.

@pixelbacon
pixelbacon / squarespaceBreakpoints.less
Last active August 16, 2024 19:46
Squarespace Breakpoints.
/**
Squarespace essentially doesn't really document their breakpoints.
This can be quite annoying to not have when doing custom CSS.
Most themes use essentially one breakpoint. Mobile and not mobile; anything 750 and below is considered mobile.
You can use these to write your own CSS and simply use the "Style Editor" to inject your compiled CSS in the event
you are not using "Developer Mode" in your site.
Enjoy!
@carolineschnapp
carolineschnapp / Add Color Swatches using hex values.md
Last active August 5, 2024 10:32
Add Color swatches to #Brooklyn theme. Use hexadecimal values or images.

What we want

We want to go from this:

Alt text

... to that:

Alt text

@kyleaparker
kyleaparker / gist:560a3847860bace1d680
Last active July 16, 2020 21:59
[Shopify] Show multiple images per variant
<script>
jQuery(document).ready(function($){
var images = [];
{% for image in product.images %}
images.push({url: "{{ image | product_img_url: 'medium' }}", alt: "{{ image.alt }}"});
{% endfor %}
var thumbnails = $(".thumbs");
@carolineschnapp
carolineschnapp / gist:66aee1dee81203dd464d
Created September 6, 2014 05:10
Classes to show or hide elements based on the screen size.
@media (max-width: 479px) {
.show-on-desktop, .show-on-tablets, .hide-on-mobile { display: none; }
}
@media (min-width: 480px) and (max-width: 979px) {
.show-on-desktop, .hide-on-tablets, .show-on-mobile { display: none; }
}
@media (min-width: 980px) {
.hide-on-desktop, .show-on-tablets, .show-on-mobile { display: none; }
}
@carolineschnapp
carolineschnapp / gist:db7fb1cf412b5e0bdeaf
Created May 29, 2014 15:06
Grab the variant currently selected with ?variant=ID in the URL, or the first in stock variant, on page load.
var optionSelectors = new Shopify.OptionSelectors...
// Grab the variant currently selected with ?variant=ID in the URL, or the first in stock variant, on page load.
optionSelectors.selectVariant({{ product.selected_or_first_available_variant.id }});
<div>
<label for="sort-by">Sort by</label>
<select id="sort-by">
<option value="manual">Featured</option>
<option value="price-ascending">Price: Low to High</option>
<option value="price-descending">Price: High to Low</option>
<option value="title-ascending">A-Z</option>
<option value="title-descending">Z-A</option>
<option value="created-ascending">Oldest to Newest</option>
<option value="created-descending">Newest to Oldest</option>
@stephenll
stephenll / .bash_profile
Created February 2, 2014 02:45 — forked from jernejcic/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
@carolineschnapp
carolineschnapp / variant-images-in-cart.html
Last active February 11, 2022 07:16
Script that updates images on the cart page to show the correct thumbnail as chosen in the Variant Images app.
{% if cart.item_count > 0 %}
<script>
// Script that updates images on the cart page to show the correct thumbnail as chosen in the Variant Images app.
// This works with any markup.
// This works when using Line Item Properties where several items in the cart form can share the same variant ID.
// Author: Caroline Schnapp.
// Place at the top of your cart.liquid template.
(function($) {
var variantImages = {},
productHandles = [];
@freakdesign
freakdesign / extract-image-liquid
Last active May 8, 2023 14:15
Get image src from a string in Liquid
{% if article.content contains "<img" %}
{% assign src = article.content | split: 'src="' %}
{% assign src = src[1] | split: '"' | first | replace: '//cdn', 'http://cdn' | replace: 'http:http://', 'http://' | remove: 'https:' %}
{% endif %}
@ijy
ijy / sublime-text-3-setup.md
Last active March 7, 2025 20:44
My Sublime Text 3 setup.

Sublime Text 3 Setup

Install Package Control

Install Package Control for easy package management.

  1. Open the console with Ctrl+`
  2. Paste in the following: