Skip to content

Instantly share code, notes, and snippets.


Rafael Santos formigarafa

View GitHub Profile
formigarafa / example.rb
Created Jun 25, 2020
Ruby 2.6.6 weird behaviour for protected method
View example.rb
class Item
def initialize(value: )
@value = value
def subitems
@subitems ||= [ 1), 2),
formigarafa / postgres_queries_and_commands.sql
Last active Oct 21, 2020 — forked from biinari/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (>= 9.2)
age(clock_timestamp(), query_start) AS age,
usename, state, query, waiting,
age(clock_timestamp(), xact_start) AS xact_age
FROM pg_stat_activity
WHERE state != 'idle'
AND query NOT ILIKE '%pg_stat_activity%'
formigarafa / eta-snippet.rb
Created Oct 4, 2017
console process feedback with ETA in ruby
View eta-snippet.rb
module EtaReport
def total
@total ||= whatever.count
def started_at
@started_at ||=
def progress_feedback(processed)
formigarafa / Dockerfile
Created Mar 1, 2017 — forked from bellbind/Dockerfile
[docker] ruby-1.8.7 with rails-2.3.18 image
View Dockerfile
# docker build -t ruby-1.8.7 .
# docker run -it --rm ruby-1.8.7
FROM ubuntu:16.04
RUN apt update
RUN apt upgrade -y
RUN apt install -y ruby-build autoconf subversion bison
RUN apt install -y mecab mecab-ipadic-utf8 wget
formigarafa / XGH -
Created Jan 15, 2017 — forked from banaslee/XGH - en.txt
eXtreme Go-Horse Process
View XGH -


1- Pensou, não é XGH.

XGH não pensa, faz a primeira coisa que vem à mente. Não existe segunda opção, a única opção é a mais rápida.

2- Existem 3 formas de se resolver um problema, a correta, a errada e a XGH, que é igual à errada, só que mais rápida.

formigarafa /
Last active Jun 4, 2016
disable trackstick on ubuntu
formigarafa / nginx_prax_proxy.conf
Last active Apr 29, 2016
prax configuration with ssl via nginx. Note: remember to stop prax service (but not the daemon)
View nginx_prax_proxy.conf
upstream prax_unsecure_backend {
server localhost:20559;
server {
listen 80;
server_name *.dev;
server_name *;
server_name *;
formigarafa /
Last active Mar 15, 2017
Basic to get google dns over https working.
formigarafa /
Last active Nov 26, 2015
weekly edms for week of 2015-11-23
runs sent fail total
simulated 768 1577 2345
for real 838 1584 2422
total 1606 3161 4767
formigarafa /
Created Nov 3, 2014
Gist title here, maybe a description


you want here