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
<script> | |
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: [email protected] | |
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus | |
// Modified by Jonathan Moore (Style Hatch) https://github.com/jonathanmoore | |
/* | |
Updated to work with sectioned themes | |
- Added required methods from the deprecated options_selection.js | |
- Triggers an initial variant change | |
- Hides sold out variants with only one option |
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
// Dependencies | |
// - https://github.com/carolineschnapp/currencies | |
// Don't change currency if Cookie has been already set | |
if (Currency.cookie.read() == null) { | |
jQuery.ajax( { | |
url: '//freegeoip.net/json/', | |
type: 'GET', | |
dataType: 'jsonp', |
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
<script> | |
jQuery.ajax( { | |
url: '//freegeoip.net/json/', | |
type: 'POST', | |
dataType: 'jsonp', | |
success: function(location) { | |
// If the visitor is browsing from Canada. | |
if (location.country_code === 'CA') { | |
// Tell him about the Canadian store. | |
jQuery.fancybox.open(jQuery('#message')); |
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
defmodule Languafy.Web.Context do | |
@behaviour Plug | |
import Plug.Conn | |
alias Languafy.User | |
def init(opts), do: opts | |
def call(conn, _) do | |
case build_context(conn) do | |
{:ok, context} -> |
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 SmoothScroll(target, speed, smooth) { | |
if (target == document) | |
target = (document.documentElement || document.body.parentNode || document.body) // cross browser support for document scrolling | |
var moving = false | |
var pos = target.scrollTop | |
target.addEventListener('mousewheel', scrolled, false) | |
target.addEventListener('DOMMouseScroll', scrolled, false) | |
function scrolled(e) { |
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
document.addEventListener('wheel', function(e) | |
{ | |
if(e.type != 'wheel') | |
{ | |
return; | |
} | |
let delta = ((e.deltaY || -e.wheelDelta || e.detail) >> 10) || 1; | |
delta = delta * (-300); | |
document.documentElement.scrollLeft -= delta; | |
e.preventDefault(); |
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 Excel = require('exceljs'); | |
XLSX = require('xlsx'); | |
var workbook = new Excel.Workbook(); | |
var wb = XLSX.readFile('dhl.xls'); | |
sheet1 = XLSX.utils.sheet_to_json(wb.Sheets.Sheet1); | |
var rows = new Array(); |
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 or export top level | |
npm: { | |
compilers: ['babel-brunch'], | |
enabled: true, | |
styles: { | |
tachyons: ['css/tachyons.min.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
def atc([], new_item) do | |
[new_item] | |
end | |
def atc([h = %{product_id: id, size: size, quantity: old_quantity}|t], %{product_id: id, quantity: growth, size: size}) do | |
[%{h | quantity: old_quantity + growth}|t] | |
end | |
def atc([h|t], new_item) do | |
[h|atc(t, new_item)] |
NewerOlder