Skip to content

Instantly share code, notes, and snippets.

View re-dev's full-sized avatar

Vaughan James re-dev

View GitHub Profile
@krohrbaugh
krohrbaugh / gist:119709
Created May 29, 2009 01:09
Poor man's subdomain redirect using JavaScript
var hostarray = new Array();
hostarray["subdomain.somewhere.com"] = "subdomain.somewhere.com/application/home.html";
function redirect()
{
//Obtain the host name in lowercase format
var lhost = new String(location.host);
lhost = lhost.toLowerCase();
@Chrisedmo
Chrisedmo / filter-vendor.liquid
Created July 31, 2012 11:14
Shopify: Filter by Vendor
<!-- add the vendor as product tag to product then use this code in collection.liquid -->
<!-- if we are on a collection page that is either custom or smart -->
{% if collection.url != blank %}
<h4>Shop by vendor:</h4>
<ul>
{% for product_vendor in collection.all_vendors %}
<li>
{% if current_tags contains product_vendor %}
<a class="active" href="{{ collection.url }}">{{ product_vendor }}</a>
{% else %}
@kulakowka
kulakowka / truncate.js
Created April 10, 2014 13:41
Jquery Truncate text in div + show more link
/**
* <div class="text">Some text with <b>html</b>... Any length.</div>
*
*/
$('.text').each(function(){
var length = 5;
var details = $(this);
var original_html = details.html();
var original_text = details.text();
var truncated_text = $.trim(original_text).substring(0, length).split(" ").slice(0, -1).join(" ") + " ";
@schoenobates
schoenobates / gp-autocomplete.js
Created November 16, 2014 22:51
Fix for Google AutoComplete Places Javascript API on iOS
var autoElm = document.getElementById('elm-name');
autocomplete = new google.maps.places.Autocomplete(autoElm);
google.maps.event.addListener(autocomplete, 'place_changed', function () {
var place = autocomplete.getPlace();
if (!place.geometry) {
return;
}
instance.setCenter(place.geometry.location);
instance.setZoom(19);
@freakdesign
freakdesign / blog-atom.liquid
Last active October 19, 2021 21:48
Shopify RSS atom feed
{% layout none %}{% comment %}
/*
* Simple blog feed
*
* Copyright (c) 2015 Jason Bowman (jason@freakdesign.com.au)
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
*/
{% endcomment %}<?xml version="1.0" encoding="UTF-8"?>
@gastonambrogi
gastonambrogi / shimmer.html
Created December 20, 2016 11:50
Shimmer CSS - Shimmer effect
<h1 class="shimmer">Some Shimmer Text</h1>
<style>
@import url('http://fonts.googleapis.com/css?family=Alegreya+Sans:300');
body{
background: #000;
}
.shimmer{
/* styling stuff */
font-family:"Alegreya Sans";
@codinet17
codinet17 / gist:bc73d2c700c0eee9f8585f139c2b4e54
Last active February 14, 2018 20:48
Shopify Auto complete address checkout
// Codi-net.com
if (window.location.href.indexOf('checkout') > -1) {
window.onload = function() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = "https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places";
script.async = "true";
script.defer = "defer";
document.body.appendChild(script);