Skip to content

Instantly share code, notes, and snippets.

View jbgutierrez's full-sized avatar

Javier Blanco Gutiérrez jbgutierrez

View GitHub Profile
<script type="customer-template" include-category="NINO" exclude-category="ZAPATO">
<style>
#ninos-msg {
text-align: center;
}
</style>
<div>NINOS menos ZAPATOS</div>
</script>
<div id="customer-template"> </div>
@jbgutierrez
jbgutierrez / README.md
Created March 3, 2020 16:33
Exercise skeleton

Getting Started

Install dependencies and launch webpack process:

npm install
npm start

Finally, launch your editor of choice and edit index.js, index.scss, and index.html.

@jbgutierrez
jbgutierrez / index.js
Last active January 25, 2018 11:40
Hello World - Passport with LocalStrategy
const express = require('express');
const passport = require('passport');
const app = express();
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const session = require('express-session');
const LocalStrategy = require('passport-local').Strategy;
passport.serializeUser((user, done) => { console.log('serialize'); done(null, user); } );
passport.deserializeUser((user, done) => { console.log('deserialize'); done(null, user); });
@jbgutierrez
jbgutierrez / .eslintrc.js
Last active May 25, 2018 17:22
Distributing Work
module.exports = {
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
@jbgutierrez
jbgutierrez / Default (Linux).sublime-keymap
Last active September 23, 2018 16:11
Sublime 2 Package - Property Extractor
[
{ "keys": ["alt+t"], "command": "extractor_command"}
]
@jbgutierrez
jbgutierrez / app.js
Created June 28, 2017 15:37
Gestión de la configuración
const config = require('./config');
console.log(config);
@jbgutierrez
jbgutierrez / Dict.coffee
Created June 16, 2017 09:40
Resolución de templates ejs
class Dict
constructor: (@g, @dict) ->
@missings = []
resolve: (content, showErrors=true, json=false, englishFallback=true) ->
fail = false
RE = if json then /"\{([^}^\s]+)\}"/g else /\{([^}^\s]+)\}/g
content = content.replace RE, (m, n) =>
replacement = @t n, showErrors, true, englishFallback
fail or= not replacement?
@jbgutierrez
jbgutierrez / confirm.sh
Last active March 2, 2017 22:24 — forked from zeroasterisk/confirm.sh
confirm.sh a simple way to add confirmation to bash scripts
# ======================================================================
#
# @link http://wuhrr.wordpress.com/2010/01/13/adding-confirmation-to-bash/#comment-3540
#
# Function: confirm
# Asks the user to confirm an action, If the user does not answer "This won't shutdown the Internet!" the script will immediately exit.
#
# Parameters:
# $@ - The confirmation message
#
{
"filter_execute": {
"\\.coffee$": {
"cmd": "webpack-versioner.sh $file $file_path/versions.manifest.json",
"shell": true
}
},
"build_on_save": 1
}
@jbgutierrez
jbgutierrez / scss-lint.py
Created May 12, 2016 20:01
scss-lint with SublimeLinter in ST2
import re
from base_linter import BaseLinter
CONFIG = {
'language': 'SCSS',
'executable': 'scss-lint.sh',
'lint_args': '{filename}'
}