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>
@rlfrahm
rlfrahm / README.md
Last active August 29, 2015 14:23
Git remove last remote commit
git reset --hard HEAD^ 

git push -f

@rlfrahm
rlfrahm / csv_reader.php
Last active August 29, 2015 14:22
How to iterate through a CSV file using PHP
// Open the file
$file = fopen($uri,'r');
// If the first line is a header, uncomment the following..
// $header = fgetcsv($file);
// Iterate through each row of the file
while(!feof($file)) {
// Read in the row
// $row will be an array of values that correspond to
// the columns in the row, example:
// array (
@rlfrahm
rlfrahm / fizzbuzz.py
Last active August 29, 2015 14:22
A quick Python implementation of Fizzbuzz (http://en.wikipedia.org/wiki/Fizz_buzz)
#!/usr/bin/python
for i in range(0,100):
three = i % 3
five = i % 5
if three == 0 and five == 0:
print 'fizzbuzz'
elif three == 0:
print 'fizz'
elif five == 0:
@rlfrahm
rlfrahm / README.md
Last active August 29, 2015 14:11
AngularJs ngOptions for array and object types

AngularJS : ngOptions for Arrays and Objects

@rlfrahm
rlfrahm / README.md
Last active August 29, 2015 14:10
A custom context menu using AngularJs and Bootstrap

AngularJS : An example of a custom context menu.

Right click in the window to view.

@rlfrahm
rlfrahm / README.md
Last active March 15, 2018 14:55
Example of a check all checkbox in AngularJs

AngularJS : Check all checkboxes checkbox

#####Technologies

  • AngularJs
  • Twitter Bootstrap
@rlfrahm
rlfrahm / index.html
Last active August 29, 2015 14:10
CSS3 Activity spinner
<div class="loader">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<style>
.loader {
@rlfrahm
rlfrahm / README.md
Last active August 29, 2015 14:09
CSS3 Windows 8 Activity Spinner

This activity spinner is an adaptation from this Codepen, and is commonly seen in Windows 8.