Skip to content

Instantly share code, notes, and snippets.

View rlfrahm's full-sized avatar
A Bugatti has 2 seats & a bus has many. Few will support your path 2 success.

Ryan Frahm rlfrahm

A Bugatti has 2 seats & a bus has many. Few will support your path 2 success.
View GitHub Profile
@rlfrahm
rlfrahm / Shopify tag filter groups
Created October 27, 2019 21:24 — forked from darryn/Shopify tag filter groups
Create tag filter groups in Shopify. This snippet is designed to group and separate out collection tags. It requires the tags to share a common value prepended to the tag with an underscore. E.g. to create a separate tag filter group for 'brands', each product will need to be tagged with 'brand_Nike' or 'brand_Reebok'. Some of this is probably l…
{% if template contains 'collection' and collection.all_tags.size > 1 %}
<!-- A recursive loop to catch and filter out the different tag categories -->
{% assign c = 0 %}
{% for t in collection.all_tags %}
{% capture cat %}{{ cat }}{% capture temp_cat %}{% if t contains '_' %}{% assign cat_grp = t | split: '_' %}{{ cat_grp.first }}{% endif %}{% endcapture %}{% unless cat contains temp_cat %}{% if t contains '_' %}{% assign new_cat_grp = t | split: '_' %}{{ new_cat_grp.first }}{% endif %}{% unless forloop.last %}+{% endunless %}{% assign c = c | plus: 1 %}{% endunless %}{% endcapture %}
{% endfor %}
<!-- create array of tag categories -->
{% assign cat_array = cat | split: '+' %}
@rlfrahm
rlfrahm / index.html
Last active May 24, 2017 15:14 — forked from kkiernan/index.html
A Vue.js filter that formats a phone number. Adapted for Vue.js 2.0
<div id="vue">
<input type="text"
name="home_phone"
class="form-control"
v-model="homePhone"
v-on:keyup="formatPhone()"
lazy>
</div>