Skip to content

Instantly share code, notes, and snippets.


Igor Escobar igorescobar

Block or report user

Report or block igorescobar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
igorescobar / imageboss-url.js
Last active Oct 27, 2019
Generating ImageBoss URLs with JavaScript
View imageboss-url.js
function mountImageBossUrl(src, { operation, cover_mode, width, height, options }) {
var serviceUrl = '';
var template = '/:operation/:options/';
if (operation === 'cover') {
template = '/:operation::cover_mode/:widthx:height/:options/';
} else if (operation === 'width') {
template = '/:operation/:width/:options/';
} else if (operation === 'height') {
template = '/:operation/:height/:options/';
View valida-date-mask.js
$(".data").mask("AB/CD/0000", {
A: {pattern: /[0-3]/},
B: {pattern: /[0-9]/},
C: {pattern: /[0-1]/},
D: {pattern: /[0-9]/},
onKeyPress: function(a, b, c, d) {
if (!a) return;
var m = a.match(/(\d{2})/g);
igorescobar /
Created Feb 16, 2016
The correct way to run rails db migration on AWS Beanstalk (Docker Container Environment)
# .ebextensions/scripts/
. /opt/elasticbeanstalk/hooks/
EB_SUPPORT_FILES=$(/opt/elasticbeanstalk/bin/get-config container -k support_files_dir)
while read -r ENV_VAR; do
igorescobar / git-spush.bash
Last active Apr 10, 2019
Git alias to run your maven tests before push your changes to remote
View git-spush.bash
git config alias.spush='!sh -c "mvn clean test && git push \$1 \$2 \$3"'
igorescobar /
Last active May 3, 2018
Docker useful commands
# Clean unused images
docker image prune
# Clean up dangling volumes
docker volume rm $(docker volume ls -qf dangling=true)
# Stop all containers
docker stop $(docker ps -a -q)
igorescobar / 01_sync_postgres_sequences.sql
Last active Jan 10, 2018
Syncing Postgres Sequences for All Tables
View 01_sync_postgres_sequences.sql
quote_literal(quote_ident(PGT.schemaname) || '.' || quote_ident(S.relname)) ||
', COALESCE(MAX(' ||quote_ident(C.attname)|| '), 1) ) FROM ' ||
quote_ident(PGT.schemaname)|| '.'||quote_ident(T.relname)|| ';'
FROM pg_class AS S,
pg_depend AS D,
pg_class AS T,
pg_attribute AS C,
pg_tables AS PGT
igorescobar / delete_git_old_tags.rb
Created Dec 12, 2017
A utility for deleting old git tags
View delete_git_old_tags.rb
# CUT_OFF_DATE needs to be of YYYY-MM-DD format
CUT_OFF_DATE = "2016-06-30"
def get_old_tags(cut_off_date)
`git log --tags --simplify-by-decoration --pretty="format:%ai %d"`
.each_with_object([]) do |line, old_tags|
if line.include?("tag: ")
date = line[0..9]
tags = line[28..-2].gsub(",", "").concat(" ").scan(/tag: (.*?) /).flatten
igorescobar /
Last active Nov 21, 2017
Clean junk files from vendor/bundle directory
#!/usr/bin/env bash
find ./vendor/bundle \( -name '__tests__' -o \
-name "*.md" -o \
-name "*LICENSE*" -o \
-name "*.ts" -o \
-name "*.jst" -o \
-name "*.coffee" -o \
-name "*.rdoc" -o \
-name "example" -o \
-name "examples" -o \
igorescobar / phonemask.js
Created Sep 14, 2012
Mascara Javascript para os novos telefones de São Paulo
View phonemask.js
// using:
// version: v0.5.0+
var SPphoneMask = function(phone, e, currentField, options){
return phone.match(/^(\(?11\)? ?9(5[0-9]|6[0-9]|7[01234569]|8[0-9]|9[0-9])[0-9]{1})/g) ? '(00) 00000-0000' : '(00) 0000-0000';
$(".sp_celphones").mask(SPphoneMask, {onKeyPress: function(phone, e, currentField, options){
$(currentField).mask(SPphoneMask(phone), options);
igorescobar /
Created Mar 3, 2017
Connect to a PRIVATE machine through a PUBLIC machine.
# put this in your ~/.ssh/config
HostName $ip
User $username
IdentityFile $identity_file_path
ProxyCommand ssh -q -W $private_ip:$private_local_port
User $username
IdentityFile $identity_file_path
You can’t perform that action at this time.