Skip to content

Instantly share code, notes, and snippets.

View darana's full-sized avatar

darana

  • Planet Earth (usually)
View GitHub Profile
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@zakhardage
zakhardage / Shopify Wholesale Collection
Last active January 30, 2016 13:56
Shopify collection template with a quick add-to-cart button for each product for wholesale customers.
<table>
{% tablerow product in collection.products cols: 3 %}
{% assign parentCount = tablerowloop.index %}
<a href="{{ product.url | within: collection }}">
<img id="img{{ tablerowloop.index }}" src="{{ product.featured_image | product_img_url: 'large' }}" alt="{{ product.title | escape }}" />
{{ product.title }}
{% assign wholesalePriceCheck = 'unset' %}
{% for variant in product.variants %}
{% assign opt1 = variant.option1 | handle %}
@seedcms
seedcms / How To Use Shopify Upsell Modal
Last active May 18, 2022 17:26
Shopify Upsell Modal
1. add snippet to cart.liquid file at the bottom of the file
{% include 'upsell-modal' %}
2. add css to theme.liquid in the header
{{ 'upsell-modal.scss' | asset_url | stylesheet_tag }}
@cobbweb
cobbweb / lazyload-child.js
Created December 9, 2015 04:43
Lazyload Children
(function(window) {
'use strict';
var raf = window.requestAnimationFrame;
var CLOSESNESS = 2;
function startLoop(fn) {
var running = false;
var lastExit;
@carolineschnapp
carolineschnapp / hide variant images.md
Created February 18, 2016 20:11
Hide variant images on the product page, so that a variant image is shown as main image only when its corresponding variant is selected.

The goal

Hide the thumbnails of variant images on the product page.

How to do that

  1. Add a class of 'variant-image' to the wrapper of each thumbnail that is a variant image. See first product.liquid snippet.
  2. Hide all .variant-image elements with CSS in the theme's stylesheet. See second style.scss.liquid snippet.
@zakhardage
zakhardage / automatically apply price-based discount in Shopify
Created June 17, 2016 21:00
automatically apply price-based discount in Shopify
{% if cart.total_price > settings.cart-discount-threshold %}{% assign threshold = true %}{% endif %}
<form action="/cart{% if threshold %}/?discount=[discountcode]{% endif %}" method="post">
@jagrosh
jagrosh / Growing A Discord Server.md
Last active February 17, 2024 04:29
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background