Skip to content

Instantly share code, notes, and snippets.

View justincron's full-sized avatar

Justin Cron justincron

View GitHub Profile
@bohman
bohman / viewport.js
Last active March 15, 2025 07:05
jQuery get viewport size
// -----------
// Debugger that shows view port size. Helps when making responsive designs.
// -----------
function showViewPortSize(display) {
if(display) {
var height = jQuery(window).height();
var width = jQuery(window).width();
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>');
jQuery(window).resize(function() {
@resistorsoftware
resistorsoftware / Google Shopping Snippet
Last active March 22, 2021 17:01
Enhanced Meta Tagger snippet
{% comment %}
- add this snippet to any product.liquid template, at the top of the file, and you can access the extra data provided by
the new version of Meta Tagger that supports Google Shopping.
{% endcomment %}
{% if template contains 'product' %}
{% if product.metafields.global %}
{% for mf in product.metafields.global %}
@davecap
davecap / collections.liquid.html
Last active February 11, 2025 15:00
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<!-- the top of your collections.liquid -->
<!-- START PRODUCTS -->
{% for product in collection.products %}
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</div>
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->