// source: https://stackoverflow.com/questions/8043026/javascript-format-number-to-have-2-digit
function leftPad(number, targetLength) {
var output = number + '';
while (output.length < targetLength) {
output = '0' + output;
}
return output;
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
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 |
- 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
// 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 '' | |
} |
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
<template> | |
<pre> | |
<code class="hljs" :class="hljsCode.language">{{{ hljsCode.value }}}</code> | |
</pre> | |
</template> | |
<script> | |
import hljs from 'highlight.js' | |
hljs.configure({ |
1. EFI GPT
- create 500mb partition fat32 boot flag