Skip to content

Instantly share code, notes, and snippets.

View formigarafa's full-sized avatar

Rafael Santos formigarafa

View GitHub Profile
@formigarafa
formigarafa / List.md
Created October 17, 2024 21:12
activerecord-postgis-adapter pending tests

Tests excluded from activerecord-postgis-adapter pending to be fixed

To run tests for specific file remove/comment the respective exclude and use:

$ AR_TEST_FILES=test/cases/view_test.rb bundle exec rake test:activerecord

File list (based on ActiveRecord 7.2.1)

test/cases/adapters/postgresql/change_schema_test.rb
@formigarafa
formigarafa / example.rb
Created June 25, 2020 02:46
Ruby 2.6.6 weird behaviour for protected method
class Item
def initialize(value: )
@value = value
end
def subitems
@subitems ||= [
Item.new(value: 1),
Item.new(value: 2),
]
@formigarafa
formigarafa / postgres_queries_and_commands.sql
Last active October 21, 2020 09:00 — forked from biinari/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (>= 9.2)
SELECT pid,
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%'
ORDER BY age DESC;
@formigarafa
formigarafa / eta-snippet.rb
Created October 4, 2017 08:47
console process feedback with ETA in ruby
module EtaReport
def total
@total ||= whatever.count
end
def started_at
@started_at ||= Time.now
end
def progress_feedback(processed)
@formigarafa
formigarafa / Dockerfile
Created March 1, 2017 22:17 — forked from bellbind/Dockerfile
[docker] ruby-1.8.7 with rails-2.3.18 image
# docker build -t ruby-1.8.7 .
# docker run -it --rm ruby-1.8.7
FROM ubuntu:16.04
WORKDIR /root
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
formigarafa / XGH - PT-BR.md
Created January 15, 2017 23:51 — forked from banaslee/XGH - en.txt
eXtreme Go-Horse Process

Fonte: http://gohorseprocess.wordpress.com

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
formigarafa / tl_dr.md
Last active June 4, 2016 03:05
disable trackstick on ubuntu
@formigarafa
formigarafa / nginx_prax_proxy.conf
Last active April 29, 2016 14:03
prax configuration with ssl via nginx. Note: remember to stop prax service (but not the daemon)
upstream prax_unsecure_backend {
server localhost:20559;
}
server {
listen 80;
server_name *.dev;
server_name *.xip.io;
server_name *.rafael.nz;
@formigarafa
formigarafa / Google-DNS-over-HTTPS.md
Last active March 15, 2017 08:15
Basic to get google dns over https working.
@formigarafa
formigarafa / weekly_edm_report.md
Last active November 26, 2015 22:06
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