Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
carolineschnapp / related-products.liquid
Last active December 22, 2022 21:29
Related Products — to add to product.liquid
@tonkapark
tonkapark / bigcartel_to_shopify_csv.rb
Created August 3, 2011 18:06
Generate a products csv file to make it easier to migrate from Big Cartel to Shopify
#script created by Matt Anderson, http://tonkapark.com
require 'rubygems'
require 'bigcartel'
require 'csv'
# SET YOUR BIGCARTEL ID HERE
STORE = 'ugmonk'
# SET THE BEST NAME FOR ANY DROP DOWN OPTIONS
@sandeepshetty
sandeepshetty / gist:1838803
Created February 15, 2012 20:32
Verify Shopify webhook in PHP
<?php
define('SHOPIFY_APP_SECRET', 'my_shared_secret');
function verify_webhook($data, $hmac_header)
{
$calculated_hmac = base64_encode(hash_hmac('sha256', $data, SHOPIFY_APP_SECRET, true));
return ($hmac_header == $calculated_hmac);
}
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@kkamkou
kkamkou / node-microdata.js
Created October 24, 2013 12:34
Gets micro-data from html
// required stuff
var _ = require('lodash'),
cheerio = require('cheerio');
// exporting outside
module.exports = {
/**
* Converts a html code to the object
* @param {String} html
* @returns {Object}
@tomblanchard
tomblanchard / bigcartel-feed.js
Last active March 6, 2018 12:29
BigCartel Feed.
$.getJSON('http://api.bigcartel.com/USERNAME/products.json?limit=5&callback=?', function(data) {
$.each(data, function(i, obj) {
$('\
<a href="http://USERNAME.bigcartel.com' + obj.url + '">' +
obj.name +
'$' + parseFloat(obj.price, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,').toString() +
'<img width="100" src="' + obj.images[0].url + '" alt="">' +
'</a>'
).appendTo('.products');
@sfrdmn
sfrdmn / image_downloader.js
Last active January 8, 2024 03:39
Bookmarklet to download all images on a page
;(function() {
var images = [].slice.call(document.querySelectorAll('img'))
try {
images.forEach(function(img) {
downloadImage(img)
})
} catch (e) {
alert("Download failed.");
console.log('Download failed.', e);
}
@sangeeths
sangeeths / github-to-bitbucket
Created March 10, 2014 15:24
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@salcode
salcode / .gitignore
Last active February 10, 2024 10:56
See https://salferrarello.com/wordpress-gitignore/ for the latest version of my WordPress .gitignore file
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@ronaldsmartin
ronaldsmartin / GoogleSheetJson.md
Last active December 16, 2023 06:53
Google Spreadsheet JSON Queries

SheetAsJSON + Filtering

This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.

Minimal Usage

The following parameters are required for the script to work.

https://script.google.com/macros/s/AKfycbzGvKKUIaqsMuCj7-A2YRhR-f7GZjl4kSxSN1YyLkS01_CfiyE/exec?
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>