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 / 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"
@jbgutierrez
jbgutierrez / setup-continuous-deployment-ubuntu-12.10-x86_64.sh
Last active December 27, 2015 07:59
Self-contained bash script to setup continuous deployment for nodejs apps built on top of ubuntu, git and foreman
DEPLOYER='deployer'
DEPLOYER_HOME="/home/$DEPLOYER"
PROJECT_NAME='node-js-sample'
PROJECT_REPO='https://github.com/heroku/node-js-sample.git'
# Provisining an ubuntu server
apt-get -y update
apt-get -y upgrade
apt-get -y install software-properties-common
add-apt-repository ppa:chris-lea/node.js
@jbgutierrez
jbgutierrez / mental-mapping-code-smell.html
Last active December 22, 2015 15:39
Mental mapping code smell
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Mental mapping code smell</title>
<style>
.language-flag {
float: left;
}
</style>
@jbgutierrez
jbgutierrez / git-svn-relocate.sh
Created August 29, 2013 15:25
Rewriting Git History: Relocating Subversion URLs (http://goo.gl/OgudcR)
#!/bin/sh
# Must be called with two command-line args.
# Example: git-svn-relocate.sh http://old.server https://new.server
if [ $# -ne 2 ]
then
echo "Please invoke this script with two command-line arguments (old and new SVN URLs)."
exit $E_NO_ARGS
fi
@jbgutierrez
jbgutierrez / draw_bounding_box.cpp
Created July 5, 2013 08:09
Drawing a bounding box around the detected contours of an image
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <stdio.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
@jbgutierrez
jbgutierrez / gist:5764369
Created June 12, 2013 10:55
Harmony Generators vs Promisses Libs
var step = 0;
async.waterfall([
function (next){
step = 1;
getJson('/country', function(data) { next(null, data); });
},
function (country, next){
step = 2;
getJson('/weather', function(data) { next(null, country, data); });