Skip to content

Instantly share code, notes, and snippets.

View GusGA's full-sized avatar
🕶️
Reading someone else's code

Gustavo Giménez GusGA

🕶️
Reading someone else's code
  • Santiago, Chile
View GitHub Profile
@GusGA
GusGA / list_by_commiter.sh
Created July 29, 2015 02:00
lines_by_commiter
git log --numstat --pretty="%H" --author=$1 | grep -v "public/" | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'
@GusGA
GusGA / excel_validator.rb
Last active September 22, 2015 04:46
Prueba 5Rabbits
require 'roo'
module ExcelValidator
class Cause
#EXCEL_COLUMN_NAMES = ['NOMBRE DEL CLIENTE', 'ASUNTO', 'CODIGO DE LA CAUSA', 'JUZGADO', 'MATERIA', 'CODIGO', 'PERSONAS INVOLUCRADAS EN LA CAUSA']
# column_names = { id: 'NOMBRE DEL CLIENTE', .... }
class << self
def manage_file(file, **column_names)
@column_names = column_names
case File.extname(file.original_filename)
@GusGA
GusGA / fizz_buzz.ex
Created September 18, 2015 12:20
FizzBuzz Code in Elixir
defmodule FizzBuzz do
def start do
IO.inspect Enum.map(1..100, fizz_or_buzz)
end
def fizz_or_buzz(n) do
cond do
rem(n,15) == 0 -> "FizzBuzz"
rem(n,5) == 0 -> "Buzz"
@GusGA
GusGA / con_real_y_medio.rb
Last active October 16, 2015 16:28
Script de la canción de Serenata Guayanesa "Con Real y Medio"
class DefaultOrder
def order(data)
data
end
end
class RandomOrder
def order(data)
data.shuffle
end
@GusGA
GusGA / suite.rb
Created December 3, 2015 03:07
MetaFlojera
require 'open-uri'
require 'nokogiri'
module Suites
module XML
BASE_URL = 'http://menuboardmanager.com/xml/'
class << self
def prices_url
{
:week_promo => 'dallassuiteshotelDiario.xml',
@GusGA
GusGA / .bashrc
Created December 20, 2015 04:20 — forked from ameboide/.bashrc
para hacer hotfixes y releases con `hotfix` y `release` y no olvidarse de la version y el changelog
#log de commits locales que no se han pusheado
alias gl='git log --branches --not --remotes --decorate'
alias gs='git status'
alias gf='git fetch origin'
alias gd='git difftool --tool=meld -d HEAD &'
alias ga='git add -u .;git add .'
alias gb='git branch -a'
gr(){
git reset $*
{
"meta": {
"code": 200,
"requestId": "56b398a5498e7ce97bb8f1c8"
},
"notifications": [
{
"item": {
"unreadCount": 2
},
set encoding=utf-8
set nocompatible " We're running Vim, not Vi!
filetype off
:set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'mattn/emmet-vim'
Plugin 'fatih/vim-go'
@GusGA
GusGA / salsa.md
Created September 9, 2016 22:55
Salsa Picante Dulce
  • 2 kilos de aji chire con semilla
  • 4 kilos de aji dulce criollo rojito el largito con semilla
  • 1 ½ kilos de cebolla
  • 1 ½ kilos de pimenton rojo sin semilla (puede ser rocoto)
  • ½ kilo de ajo
  • ¾ taza de vinagre
  • ¾ taza de agua
  • Sal al gusto

El dulce

@GusGA
GusGA / herroku_deploy.sh
Created April 9, 2017 17:29
Heroku Deploy by Mark Bates
#!/bin/bash
set -ex
git checkout -b build
GOOS=linux buffalo build -z -o bin/heroku
git add .
git commit -a -m "binary commit"
git push heroku build:master --force
heroku run bin/heroku migrate