Skip to content

Instantly share code, notes, and snippets.

View wochap's full-sized avatar
🎯

Gean Marroquin wochap

🎯
View GitHub Profile
@wochap
wochap / gzip.conf
Created May 11, 2017 16:05
nginx config
# /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;
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
@wochap
wochap / readme.md
Created March 16, 2017 22:46
Git commands
  • Update fork repository
# add upstream
$ git remote upstream

# fetch from upstream
$ git fetch upstream

# rebase or merge with branch to update
@wochap
wochap / products.md
Last active September 20, 2016 15:58
wiltex api

Items

1. [GET] items

Example

GET

Link: api/admin/products/{id}
@wochap
wochap / helpers.js
Created September 13, 2016 16:49
Youtube video helpers
// 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 ''
}
@wochap
wochap / main.js
Last active March 3, 2019 13:11
Webpack for create emails
// 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.`)
@wochap
wochap / highlight.vue
Created September 12, 2016 02:58
vue components
<template>
<pre>
<code class="hljs" :class="hljsCode.language">{{{ hljsCode.value }}}</code>
</pre>
</template>
<script>
import hljs from 'highlight.js'
hljs.configure({
@wochap
wochap / recovery.md
Last active August 22, 2016 19:32
windows 10 env config

Recovery

  • create 500mb partition fat32 boot flag
@wochap
wochap / contact.md
Last active January 18, 2017 15:23
Zicomarket api doc

Contact

1. Get countries and regions

[GET] api

Example

@wochap
wochap / readme.md
Last active July 8, 2016 15:43
vue cli webpack fixes

Vue cli webpack fixes

# index.js - /config/index.js

assetsPublicPath: '/',

// to