This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment Note: | |
Takes a block of content, separates out the images from the text and then wraps | |
them in markup so that they can be displayed in columns side by side. | |
We split the content on tags and spaces then scan through it all looking for the things we want. | |
Why?! Because reasons! | |
%}{% endcomment %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('browserify', function () { | |
return browserify('./src/js/app.js', { | |
debug: true, // with source maps | |
transform: ['brfs', 'uglifyify'] // include file system and uglify before bundle | |
}) | |
.bundle() | |
.pipe(source('app.js')) // Pass desired output filename to vinyl-source-stream | |
.pipe(gulp.dest('./assets/js/')); // Start piping stream to tasks! | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment note: | |
We do not want certain products to be available as a standard product with the standard template so SHUT IT DOWN! | |
http://media1.giphy.com/media/bMza4SFYBEb8k/giphy.gif | |
If the product has been given the 'bundle-only' template as its default then find its appropriate (or first) bundle collection | |
and redirect the user to go to there. | |
%}{% endcomment %} | |
{% assign redirect_url = false %} | |
{% assign bundle_templates = 'sixpack,bundles,planbuilder' | split: ',' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def number_to_letter(n=1) | |
nums = *'a'..'z' | |
nums[(n % 26) - 1] * ((n-1) / 26 + 1) | |
end | |
# Smart ass one line edition by @krolaw | |
# Doesn't use an array | |
def number_to_letter_revised(n=1) | |
('a'.ord+((n-1) % 26)).chr * ((n-1) / 26 + 1) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
PM Collapse | |
Expand and collapse a target element but still show the first line of elements child content when its collapsed. | |
basic example: | |
<div class="example1"> | |
<a href="#" data-collapse="example-1-target" class="collapse-action">Expand / Collapse</a> | |
<div id="example-1-target"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.fn.textNodes = function(){ | |
return this.find(":not(iframe)").addBack().contents().filter(function(){ | |
return this.nodeType === 3; | |
}); | |
}; | |
/* wordSearch jQuery plugin */ | |
$.fn.wordSearch = function(searchTerm, options){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign thumbs_per_row = settings.thumbnails-per-row | times:1 %} | |
{% if forloop.length > thumbs_per_row %} | |
{% assign mod = forloop.index | modulo:thumbs_per_row %} | |
{% if mod == 0 %}</div><div class="row">{% endif %} | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To use add an `onswipeLeft`, `onswipeRight`, `onswipeUp` or `onswipeDown` function on any dom element | |
// i.e. document.querySelector('.my-ele').onswipeLeft = function () { ... }; | |
module.exports = function (threshold) { | |
var Swipe = function () { | |
this.threshold = threshold || 5; | |
this.xDown = null; | |
this.yDown = null; | |
this.add_event_listeners(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% capture function %} | |
{% comment note: | |
Shopify, crazily enough, does not have a global object that returns the current url like it does for the page_title. | |
So lets fake one. | |
It will take into account filtered collections. | |
It will not take into account url params and hash anchors, because reasons. | |
page_url_with_shop_domain gives you the page_url with the shop.url prepended. | |
%}{% endcomment %} | |
{% if template contains '404' %} |
OlderNewer