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 callCallbackFunction (callback) { | |
callback(); // all this does is call the function that is passed in as a parameter | |
}; | |
callCallbackFunction(function(){ | |
alert('this is inside the callback function'); | |
}); | |
// Here is another way to do basically the same thing |
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
span, input { | |
margin: 0; | |
padding: 0; | |
} | |
span { | |
display: inline-block; | |
border: 1px solid black; | |
height: 25px; | |
overflow: hidden; | |
} |
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
/* | |
OpenKeyVal Wrapper | |
Author: Chris Gregory ([email protected]) | |
Description: Obscures openkeyvalue variable names for added protection against variable name overwrites | |
*/ | |
var OKV = (function($, sudoKey) { | |
var okv = {}, |
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
@mixin bgSprite($left: 0, $top: 0, $width: auto, $height: auto, $img: $sprite, $repeat: no-repeat) { | |
overflow: hidden; | |
width: $width; | |
height: $height; | |
background: transparent $img (0 - $left) (0 - $top) $repeat; | |
} | |
@mixin roundEachCorner($tl: 0, $tr: 0, $br: 0, $bl: 0) { | |
-webkit-border-top-left-radius: $tl; | |
-webkit-border-top-right-radius: $tr; |
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
{% for product in collections.All.products %} | |
<div class="img-wrapper"> | |
<img src="{{ product.images | first | product_img_url: 'medium' }}" alt="{{ product.title | escape }}"> | |
</div> | |
{% endfor %} |
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 waitForImages(selector, callback) { | |
var loaded = 0; | |
$(selector).load(function() | |
{ | |
loaded++; | |
if (loaded == $(selector).length) | |
{ | |
callback(); | |
} | |
}); |
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 getCartData(callback) { | |
Shopify.getCart(function(cart){ | |
callback(cart); | |
}); | |
} | |
function updateCartAttributes(data, callback) { | |
var params = { | |
type: 'POST', | |
url: '/cart/update.js', |
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
<div id="looper"> | |
{% assign range = 5 %} | |
{% assign min = 0 %} | |
{% assign max = range %} | |
{% assign iter = 0 %} | |
{% assign arr = 'asdfasdf,asdfasf,aafa,asdfas,asass,asdsd,asdads,asdfasf,asdadss,aflkjlfakl,asldf,asldkfjasl,aslas,asldkfjasldkfjasdkf,lskl,asdlfjadslkf,asdfasfs,asdflkjasdl,asdlfkjaslf,asdfas,asdlfkjasdfl,asdfalda' | 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
import datetime | |
# Checks too see if date is within a range | |
def is_within_date(date, min_date, max_date): | |
# Convert MM/DD/YYYY string format to datetime date | |
def convert_string_to_date(date_string): | |
month,day,year = date_string.split("/") | |
return datetime.date(int(year), int(month), int(day)) | |
day = convert_string_to_date(date) | |
day_min = convert_string_to_date(min_date) |
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 getCart(callback) { | |
var rnum = Math.floor((Math.random()*1000000000)+1), | |
rand_url = '/cart.js?' + rnum; | |
jQuery.getJSON(rand_url, function (cart, textStatus) { | |
if ((typeof callback) === 'function') { | |
callback(cart); | |
} | |
else { |
OlderNewer