Skip to content

Instantly share code, notes, and snippets.

@rdallaire
rdallaire / test.html
Created December 10, 2014 01:16
firebase get data
<script src='https://cdn.firebase.com/js/client/2.0.4/firebase.js'></script>
<script>
// var fb = new Firebase("https://sizzling-heat-3015.firebaseio.com/");
// fb.set({ name: "Alex bob" });
// fb.on("value", function(data) {
// var name = data.val() ? data.val().name : "";
// alert("My name is " + name);
/*
Events Widget
Author: Ross Dallaire, Andrew Anderson
Website: crystalcommerce.com
Google Calendar API v3 Refrence
https://developers.google.com/google-apps/calendar/v3/reference/
https://developers.google.com/google-apps/calendar/v3/reference/calendars#methods
CrystalCore.libs.backstage = {
name: 'backstage',
version: '2.0.1',
init: function(scope, method, settings) {
var self = this;
{% comment %} This replaces product.sell_price with the top variants price {% endcomment %}
{% for variant in product.variants %}
{% if forloop.first %}
{% assign productTopPrice = variant.sell_price %}
{% if product.msrp_to_f > variant.sell_price_to_f %}
{% assign productMsrp = true %}
{% for cat in product.category.self_and_ancestors %}
{% if forloop.first %}
{% assign parentID = cat.id %}
{% assign parentName = cat.name %}
{% assign parentUrl = cat.url %}
@rdallaire
rdallaire / _test.liquid
Created September 5, 2014 20:59
pizza
<div class="product-container dynamic large-4 columns">
<div class="tall-slider">
<div class="slide">
<h2>Featured Products</h2>
{% comment %}
======================================================
To account for the differences between client time
and server time (PST), set the "offset" variable. To
find the offset, solve for X, using the equation below:
(server time) + X = (client Time)
Sample UK Time: -8 + X = 0 (so X = 8)
<!--
This is the controller for the "choose your game"
landing page. This file assigns tag names and such for
dynamic content population on Landing Pages.
Top Slider (banner manager) "Top Slider {{ page name }}"
Deal of the Deal (dynamic display) "Daily-Day-Month-Year-{{ page name }}"
Top Sellers (dynamic display) "Top Sellers {{ page name }}
Featured (banner manager) "Featured {{ page name }}"
<div class="product-container dynamic small-4 column">
<h2>Featured Products</h2>
{% assign tagName = 'foil' %}
{% assign tagLimit = '8' %}
<ul class="products list" data-tagname="{{ tagName }}" data-taglimit="{{ tagLimit }}">