Skip to content

Instantly share code, notes, and snippets.

View jbgutierrez's full-sized avatar

Javier Blanco Gutiérrez jbgutierrez

View GitHub Profile
@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}'
}
@jbgutierrez
jbgutierrez / propuesta.txt
Created April 27, 2016 10:35
Propuesta de nombrado de claves de localización
// ahora
diccionarios = [channel_][territory_]language
templates = [channel_][territory_]language
configuraciones = [channel_]territory[_language]
// propuesta
The locale naming convention is:
language[_territory][.codeset][@modifier]
where a two-letter language code is from ISO 639, a two-letter territory code is
from ISO 3166, codeset is the name of the codeset that is being used in the
@jbgutierrez
jbgutierrez / app.coffee
Created April 3, 2016 16:36
Mailing Service
express = require 'express'
skipper = require 'skipper'
nodemailer = require 'nodemailer'
app = express()
verifyToken = (req, res, next) ->
token = req.body.token || req.query.token || req.headers['x-access-token']
if token is process.env.TOKEN
next()
else
#!/usr/bin/env ruby
# coding: UTF-8
require "./db2jcc4.jar"
require "./db2jcc_license_cu.jar"
query = <<-eos
select 'hello' as foo, 'world' as bar
from sysibm.sysdummy1
eos
@jbgutierrez
jbgutierrez / export-todos.rb
Last active December 29, 2015 10:46
Migrate Things tasks to Asana
#!/usr/bin/env ruby
# coding: UTF-8
require "logger"
require "pp"
require "yaml"
require "active_support/inflector"
logger = Logger.new $stderr
logger.level = Logger.const_get ENV.fetch "LOG_LEVEL", "INFO"