Skip to content

Instantly share code, notes, and snippets.

View marioloncarek's full-sized avatar

Mario Loncarek marioloncarek

View GitHub Profile
@jconnoll
jconnoll / gist:1230826
Created September 21, 2011 00:26
Shopify display Variant prices on Specific pricing Collections
{% if collection.handle == "325-475" %}
{% for variant in product.variants %}
{% if variant.price >= 32500 and variant.price <= 47500 %}
<br><span class="collection-size">{{ variant.title }}</span>
<span class="collection-price">{{ variant.price | money }}</span></h4>
{% endif; %}
{% endfor %}
{% elsif collection.handle == "500-and-up" %}
{% for variant in product.variants %}
{% if variant.price >= 50000 %}
@rickydazla
rickydazla / collections.liquid.html
Created November 24, 2011 04:12 — forked from davecap/collections.liquid.html
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>
@jconnoll
jconnoll / gist:1436411
Created December 6, 2011 02:23
Shopify - In product page get the collection it's in
{% for link in linklists[settings.sidebar_linklist_1].links %}{% for p in collections[link.object.handle].products %}{% if p.title == product.title %}{% assign: collectionName = link.object.handle %}{% endif %}{% endfor %}{% endfor %}
{% for link in linklists[settings.sidebar_linklist_1].links %}
<li><a href="{{ link.url }}"{% if link.url == active_url %} class="current"{% endif %}{% if template == 'article' and link.url == blog.url %} class="current"{% endif %}{% if collection.url == link.url %} class="current"{% endif %}
{% if link.handle == collectionName %} class="current"{% endif %}
>{{ link.title }}</a></li>
{% endfor %}
@incredimike
incredimike / variousCountryListFormats.js
Last active June 27, 2025 07:11
List of Countries in various Javascript data structures: Alphabetical country lists & Country data objects.
// Lists of countries with ISO 3166 codes, presented in various formats.
// Last Updated: July 30, 2020
// If you're using PHP, I suggest checking out:
// https://github.com/thephpleague/iso3166
// or Laravel: https://github.com/squirephp/squire
//
// JS developers can check out:
// https://www.npmjs.com/package/iso3166-2-db
//
@rickydazla
rickydazla / collections.liquid.html
Created December 17, 2011 05:42 — forked from davecap/collections.liquid.html
"Infinite" (non-auto) scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>
@peteboere
peteboere / jquery.alterclass.js
Created December 24, 2011 12:49
jQuery alterClass plugin: Remove element classes with wildcard matching. Optionally add classes.
/**
* jQuery alterClass plugin
*
* Remove element classes with wildcard matching. Optionally add classes:
* $( '#foo' ).alterClass( 'foo-* bar-*', 'foobar' )
*
* Copyright (c) 2011 Pete Boere (the-echoplex.net)
* Free under terms of the MIT license: http://www.opensource.org/licenses/mit-license.php
*
*/
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
{% assign shipping_section = '' %}
{% assign blog = blogs.faq %}
{% paginate blog.articles by 100 %}
{% for article in blog.articles %}
{% if article.tags contains 'Shipping' %}
{% capture shipping_section %}{{ shipping_section }}<li>{{ article.title | link_to: article.url }}</li>{% endcapture %}
{% endif %}
{% endfor %}
{% endpaginate %}
@pascaldevink
pascaldevink / scrollspy.js
Created April 13, 2012 20:53
ScrollSpy in pure javascript
/*
Copyright (C) 2021 Pascal de Vink (Tweakers.net)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@loudnarrative
loudnarrative / html5audiofade.js
Created April 16, 2012 03:18
Fade out HTML5 audio
// every second your audio element is playing
$(audioElement).on('timeupdate', function() {
var vol = 1,
interval = 200; // 200ms interval
if (Math.floor(audioElement.currentTime) == 15) {
if (audioElement.volume == 1) {
var intervalID = setInterval(function() {
// Reduce volume by 0.05 as long as it is above 0
// This works as long as you start with a multiple of 0.05!
if (vol > 0) {