Link: api/admin/products/{id}
This file contains hidden or 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
<template> | |
<pre> | |
<code class="hljs" :class="hljsCode.language">{{{ hljsCode.value }}}</code> | |
</pre> | |
</template> | |
<script> | |
import hljs from 'highlight.js' | |
hljs.configure({ |
This file contains hidden or 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
// require('./email.scss') | |
const css = require('!!raw-loader!inline-style!sass!./email.scss') | |
// const template = require('ejs-compiled!./emails/contact.ejs') | |
// const template = require('ejs-compiled!./emails/a-customer.ejs') | |
const template = require('ejs-compiled!./emails/l-customer.ejs') | |
function getStyles (...selectors) { | |
return selectors.reduce((styles, selector) => { | |
if (!css[selector]) { | |
console.warn(`The '${selector}' selector doesn't exist.`) |
This file contains hidden or 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
// get youtube video id | |
function getYtId (url) { | |
let match = url.match(/^.*(?:youtu.be\/|v\/|e\/|u\/\w+\/|embed\/|v=)([^#&\?]*).*/) | |
if (match) { | |
return match[1] | |
} | |
return '' | |
} |
- Update fork repository
# add upstream
$ git remote upstream
# fetch from upstream
$ git fetch upstream
# rebase or merge with branch to update
This file contains hidden or 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 const mapState = normalizeNamespace((namespace, states, alias = []) => { | |
const res = {} | |
normalizeMap(states).forEach(({ key, val }, index) => { | |
res[alias[index] || key] = function mappedState () { | |
let state = this.$store.state | |
let getters = this.$store.getters | |
if (namespace) { | |
const module = getModuleByNamespace(this.$store, 'mapState', namespace) | |
if (!module) { | |
return |
This file contains hidden or 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
# /etc/nginx/conf.d/gzip.conf | |
# activar gzip | |
gzip on; | |
# 75% de reduccion | |
gzip_comp_level 5; | |
# usar gzip en clientes conectados mediante un proxy | |
gzip_proxied any; |
This file contains hidden or 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
// getScript({ url, id }) { | |
// return new Promise(resolve => { | |
// const head = document.getElementsByTagName("head")[0]; | |
// const script = document.createElement("script"); | |
// let done = false; | |
// script.src = url; | |
// if (id) { | |
// script.id = id; | |
// } | |
// // attach handlers for all browsers |