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
exportImage(event) { | |
event.stopPropagation(); | |
this.ctx.fillStyle = "#333333"; | |
this.ctx.font = 'bold 16px Helvetica, Arial, sans-serif'; | |
this.ctx.textBaseline = "top"; | |
var textSize = this.ctx.measureText("esimov.com"); | |
//this.ctx.fillText("esimov.com", this.size - textSize.width - 10, 5); | |
//retrieve canvas image as data URL: |
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
let cacheVersion = 10; | |
let apiCacheName = 'api'; | |
let staticCacheNamespace = 'static'; | |
let staticCacheName = staticCacheNamespace + '-' + cacheVersion; | |
let staticFiles = [ | |
'/', | |
'/index.html', |
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
'use strict'; | |
window._ = {}; | |
_.templateSettings = { | |
evaluate: /<%([\s\S]+?)%>/g, | |
interpolate: /<%=([\s\S]+?)%>/g, | |
escape: /<%-([\s\S]+?)%>/g | |
}; |
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
/* | |
* Converts firebase object to Array; | |
* Each object from the array will contain 'key' property, | |
* corresponding to the firebase key | |
* */ | |
const toArray = function (firebaseObj) { | |
return Object.keys(firebaseObj).map((key)=> { | |
return Object.assign(firebaseObj[key], {key}); |
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
//Test if the PWA is running in standalone mode | |
window.matchMedia( '(display-mode: standalone)' ).matches |
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(window){ | |
const mediaRegex = /img|video/gi; | |
const linkStyles = { | |
display: 'inline-block', | |
padding: '5px 10px', | |
backgroundColor: '#ffffff', | |
color: '#262626', | |
fontWeight: '600', | |
cursor: 'pointer', |
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 {TRACKING_ID} from '../appConfig'; | |
import store from '../store/store'; | |
let gaAvailable = false; | |
let ga = null; | |
const loadAnalytics = () => { | |
const isPageSpeedBot = (navigator.userAgent.indexOf('Speed Insights') !== -1); | |
const blockTracking = store.getters.track.toString() === 'false'; | |
if (blockTracking || isPageSpeedBot) { |
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
<?php | |
$args = array( | |
'post_type' => 'product', | |
'stock' => 1, | |
'posts_per_page' => 4, | |
'orderby' => 'date', | |
'order' => 'DESC' | |
); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post(); |
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
/* | |
Package.json | |
{ | |
"name": "gulpdev", | |
"version": "0.0.1", | |
"description": "", | |
"main": "index.php", | |
"scripts": { | |
"dev": "gulp" |
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
export default function slugify(text) { | |
const a = 'àáäâèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;'; | |
const b = 'aaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------'; | |
const p = new RegExp(a.split('').join('|'), 'g'); | |
/* eslint-disable */ | |
return text | |
.toString() | |
.toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - |