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
/* | |
http://juandresyn.com/reset-css-el-codigo-basico | |
v3.5 | 20140801 | |
License: none (public domain) | |
*/ | |
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,300,600,700); |
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(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("geolocator",[],t):"object"==typeof exports?exports.geolocator=t():e.geolocator=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.i=function(e){return e},t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=7)}([function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=O |
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
// As a prototype | |
/* | |
* @param property string - The object propperty to group by. | |
*/ | |
Array.prototype.groupBy = function (property) { | |
const filtered = this.reduce(function(item, x) { | |
if (!item[x[property]]) { item[x[property]] = []; } | |
item[x[property]].push(x); | |
return item; |
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 pilesOfBoxes(boxesInPiles) { | |
boxesInPiles.sort() | |
let currentHeight = boxesInPiles[boxesInPiles.length - 1]; | |
let totalMoves = 0; | |
for (i = boxesInPiles.length - 2; i >= 0; i-- ) { | |
if (boxesInPiles[i] !== currentHeight) { | |
totalMoves += boxesInPiles.length - (i + 1); | |
currentHeight = boxesInPiles[i]; | |
} |
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
{% assign current_url = '' %} | |
{% case template %} | |
{% when 'page' %} | |
{% assign current_url = page.url %} | |
{% when 'blog' %} | |
{% assign current_url = blog.url %} | |
{% when 'article' %} | |
{% assign current_url = article.url %} | |
{% when 'collection' %} |
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
const imageService = (img, w, h = w) => { | |
const imgSplit = img.split('.'); | |
const imgFormat = imgSplit[imgSplit.length - 1]; | |
const imgFirst = img.split(`.${imgFormat}`)[0]; | |
return `${imgFirst}_${w}x${h}.${imgFormat}`; | |
}; | |
// imageService('https://cdn.shopify.com/s/files/1/0175/8496/t/65/assets/Beckett-Simonon-Oxfords-Durant-Yates-Dean.jpg?1723', 360) | |
// returns -> "https://cdn.shopify.com/s/files/1/0175/8496/t/65/assets/Beckett-Simonon-Oxfords-Durant-Yates-Dean_360x360.jpg?1723" |
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
const objectToArray = (obj) => { | |
const tempArray = []; | |
Object.keys(obj).forEach((i) => tempArray.push(obj[i])); | |
return tempArray; | |
} |
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
const initialDate = '07/29/2019'; | |
export const monthsArray = ['January','February','March','April','May','June','July','August','September','October','November','December']; | |
export const dayNames = ['Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat']; | |
/* | |
* @param padd Boolean - Add or not a 0 to the beginning of the number. | |
*/ | |
export const getWeekDate = (padd) => { | |
const currentDate = new Date(); // get current date |
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
const getUrlParameter = (name) => { | |
const nameClean = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | |
const regex = new RegExp('[\\?&]' + nameClean + '=([^&#]*)'); | |
const results = regex.exec(location.search); | |
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); | |
}; | |
const removeUrlParameter = (url, paramKey) => { | |
const r = new URL(url); | |
r.searchParams.delete(paramKey); |
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 handleVisibleElements(modal, hide = null) { | |
let parent = $(modal).parent(); | |
let grandparent = null; | |
const parentCount = $(modal).parents().length - 1; | |
const mainTag = $('body main').length ? 'main' : 'body'; | |
const tagToCheck = $(`${mainTag} > article`).length | |
? 'article' | |
: '.wrapper'; | |
const hideSiblings = element => { | |
$(element) |
OlderNewer