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 / questions.md
Last active July 10, 2018 01:53
Posible Erlang test questions

When Link to or monitor a erlang process

Link

  • Have a dependency on a process (i.e: you can't run if a specific process dies). This fits great into supervisor trees.
  • Have a bidirectional dependency, where a parent can't run if the child dies, and you also want to kill the child if the parent dies in turn.
  • Only need 1 link between processes (remember that if A and B are linked, all subsequent calls to link/2 will be ignored).
  • You are a supervisor, or you want some kind of physical relationship between your processes in your architecture (i.e: you actually need to die or restart or try something out to fix the situation that led to the death of your child.

Monitor

@GusGA
GusGA / strong_params_helpers.rb
Created November 30, 2017 22:05 — forked from BGuimberteau/strong_params_helpers.rb
Strong parameters with grape
module StrongParamsHelpers
extend Grape::API::Helpers
def permitted_params
@permitted_params ||= declared(params, include_missing: false, include_parent_namespaces: false)
end
end
@GusGA
GusGA / video_downloader.rb
Created July 30, 2017 17:24
Descargas videos de listados m3u8
require 'smarter_csv'
require 'i18n'
require 'uri'
I18n.config.available_locales = :en
def filename(index, name)
new_name = I18n.transliterate(name.split(' ').map(&:downcase).join('_')).gsub("?",'')
return "#{index + 1}_#{new_name}.mp4"
end
@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
@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

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'
{
"meta": {
"code": 200,
"requestId": "56b398a5498e7ce97bb8f1c8"
},
"notifications": [
{
"item": {
"unreadCount": 2
},
@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 $*
@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 / 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