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
// method one | |
fetch(`/search?view=json&q=tee}`) | |
.then(response => response.json()) | |
.then(data => console.log(data)); | |
// method 2 | |
const search = async e => { | |
const query ="cuff"; | |
const {results, count} = await getResults(query); | |
//const html = results.map(generateItemHtml).join(''); |
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
// Getting a file through XMLHttpRequest as an arraybuffer and creating a Blob | |
var rhinoStorage = localStorage.getItem("rhino"), | |
rhino = document.getElementById("rhino"); | |
if (rhinoStorage) { | |
// Reuse existing Data URL from localStorage | |
rhino.setAttribute("src", rhinoStorage); | |
} | |
else { | |
// Create XHR and FileReader objects | |
var xhr = new XMLHttpRequest(), |
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
router.get("/", (req, res) => { | |
const msg = req.flash("success"); | |
console.log("success: "+ msg ); | |
res.render("admin", { | |
title: "admin pages", | |
success: msg | |
}); | |
}); |
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 image in product.images %} | |
<div class="swiper-slide" {% if featured_image == image %}data-featured="true"{% endif %}> | |
<a data-image-id="{{ image.id }}" class="mpi product-gallery__image product-gallery__image-{{ forloop.index }}" href="{{ image | product_img_url: '2048x' }}" title="{{ image.alt | escape }}" data-full-size-src="{{ image | product_img_url: 'master' }}"> | |
{% include 'responsive-image', image: image %} | |
</a> | |
</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
var Shopify = Shopify || {}; | |
// --------------------------------------------------------------------------- | |
// Money format handler | |
// --------------------------------------------------------------------------- | |
Shopify.money_format = "${{amount}}"; | |
Shopify.formatMoney = function(cents, format) { | |
if (typeof cents == 'string') { cents = cents.replace('.',''); } | |
var value = ''; | |
var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/; | |
var formatString = (format || this.money_format); |
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
/* | |
* Project: Shopify AJAX Cart Plugin | |
* Description: Provides AJAX cart functionality for interacting with the Shopify AJAX API so you don't need an "Update Cart" button | |
* Dependency: jQuery 1.6+ | |
* Author: Ryan Marshall ([email protected]) | |
* License: Free | |
* Usage: | |
* | |
* $('#cart-form').shopifyAJAXCart({ | |
* item: '.line-item-container', |
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
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var replace = require('gulp-replace'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var concat = require('gulp-concat'); | |
gulp.task('compilesass', function() { | |
// root SASS file (contains all your includes) | |
return gulp.src('./sass/style.scss') | |
// compile SASS to CSS |
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
this.Shopify = this.Shopify || {}; | |
this.Shopify.theme = this.Shopify.theme || {}; | |
this.Shopify.theme.product = (function (exports) { | |
'use strict'; | |
/** | |
* Find a match in the project JSON (using a ID number) and return the variant (as an Object) | |
* @param {Object} product Product JSON object | |
* @param {Number} value Accepts Number (e.g. 6908023078973) | |
* @returns {Object} The variant object once a match has been successful. Otherwise null will be return |
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
{% comment %} | |
-- documentation | |
-- https://developers.carthook.com/docs/how-to-skip-the-cart-page-with-the-carthook-checkout | |
{% endcomment %} | |
<form action="/checkout" style="display: none;"> | |
<a href="/checkout" name="checkout" style="display: none;"></a> | |
</form> |
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
var pSettings={progressBg:"#23468c",progressBg2:"#d9e3f7",highDemandText:"An item you ordered is in high demand. No worries, we have reserved your order.",discountText:"Enter your discount code here",whyUsImg1:"",whyUsTitle1:"The course helped me put safety back in my daily routine not only in the workplace but at home aswell.",whyUsText1:"-- Rob H. ",whyUsImg2:"",whyUsTitle2:"It made me aware the quickest way to do things is not always the safest way. That you need to be aware of your surroundings and surroundings of others ",whyUsText2:"-- Dave P. ",whyUsImg3:"",whyUsTitle3:"Easy to operate without being a computer expert. ",whyUsText3:"-- Peter S. "};function crC(e,t,s){if(s){var i=new Date;i.setTime(i.getTime()+60*s*1e3);var n="; expires="+i.toUTCString()}else n="";document.cookie=e+"="+t+n+"; path=/"}function rdC(e){for(var t=e+"=",s=document.cookie.split(";"),i=0;i<s.length;i++){for(var n=s[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return n |
NewerOlder