Skip to content

Instantly share code, notes, and snippets.

View tinogomes's full-sized avatar
😀

Celestino Gomes tinogomes

😀
View GitHub Profile
@tinogomes
tinogomes / gist:bf7d8efaf7631ba14a69fddc6072abac
Last active February 17, 2021 21:13
frquencia de canais de TV rio de janeiro

Tv digital no Rio de Janeiro, tabela de canais e frequências. Para quem esta procurando uma tabela de frequência da Tv Digital aqui no Rio de janeiro tenho uma conseguida através de um Set Top Box da Aquário o DTV6000.

Canal          Freq Mhz.              Emissora.
21               515.1                Rede Tv-  Rede Tv 3D
                 521.1                Rede vida HD ---------- Canal 34.1
24               533.1                Sbt    HD
27               551.1                Cnt    Digital
29 563.1 Globo HD
@tinogomes
tinogomes / ssl_puma.sh
Created September 7, 2017 01:29 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
SO KOREANO
E ODEIO BARZIL VOCES
BRAZILEIRO É PORCO
VOCE GOSTA DE FEIJOADA
VOCE GOSTA DE CAIPIRINHA
LULA DILMA ASASINO
BRAIZL PORCOS
CRIME OCORE NADA ACOTECE FEIJOADA
@tinogomes
tinogomes / cartorios_ori_rj.csv
Last active August 8, 2017 03:55
Cartórios de registro de imóveis do Rio de Janeiro
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
"nome","endereco","bairro","cidade","uf","cep","telefones","site","abragencia"
"1º OFÍCIO DO REGISTRO DE IMÓVEIS","Rua Arquias Cordeiro, 486","Méier","Rio de Janeiro","RJ","20770001","(0xx21) 2581-1942 e 2501-2887","","Engenho Novo, Maria da Graça, Cachambi, Trecho Av. Suburbana até o n° 5775 (ímpar), Méier, Lins de Vasconcelos, Todos os Santos, Jacaré, Jacarezinho, Riachuelo."
"2º OFÍCIO DO REGISTRO DE IMÓVEIS - Cartório Fernando Bezerra Falcão","Av. Nilo Peçanha, 26 / 5º andar","Centro","Rio de Janeiro","RJ","20020100","(0xx21) 2533-9654 e 2533-9655 / 4180","","São Conrado, Gávea, Leblon, Centro (parte), Jardim Botânico, Santo Cristo, Santa Teresa, Humaitá (parte)."
"3º OFÍCIO DO REGISTRO DE IMÓVEIS","Av. Presidente Antônio Carlos, 607 / 9º andar","Centro","Rio de Janeiro","RJ","20020010","(0xx21) 2533-9620 e 2533-9579","","Botafogo, Humaitá, São Cristóvão, Urca e Ilha de Paquetá."
"4º OFÍCIO DO REGISTRO DE IMÓVEIS","Av. General Justo, 335 / 3º Pavimento","Centro","Rio de Janeiro","RJ","20021130","","http:/
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active April 15, 2024 07:22
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
# ruby rails_single_file.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
@tinogomes
tinogomes / helpers_decorators_presenters.markdown
Created June 22, 2017 20:59
Helpers, Decorators e Presenters

Helpers, Decorators e Presenters

O que são os Helpers no Rails?

O Helper no Rails fica localizado em app/helpers e é nada mais que um módulo auto-injetado no contexto da view, ou seja, os métodos implementados neste módulo Helper estarão disponíveis no contexto da view. Até a versão 3 do Rails, os Helpers eram aplicados considerando o controller que está em uso. O que isso significa, o helper app/helpers/carts_helper.rb seria aplicado apenas nas views referentes ao controller app/controllers/carts_controller.rb. Para criar um Helper que fosse comum entre controllers, o mesmo era criado como ApplicationHelper (app/helpers/application_helper.rb). A partir do Rails 4, todos os Helpers são aplicados para todos os controllers.

Exemplo:

#!Ruby
@tinogomes
tinogomes / RubyChecklistHeroku.md
Last active February 10, 2017 14:39
11 Takeaways - The Checklist for Fast Ruby Apps on Heroku

11 Takeaways - The Checklist for Fast Ruby Apps on Heroku

  1. Use a performance monitoring solution. I use NewRelic, but only because it’s the easiest to use on Heroku and I haven’t used it’s main competitor in the Ruby app space, Skylight. Pay attention to NewRelic’s Appdex scores in particular, because they take into account the inherent variance of site response time over time. In addition, pay particular attention to time spent in the request queue for the reasons mentioned above - it’s your most important scaling metric.
  2. Spend time debugging your top 5 slowest web transactions on a weekly basis. Another enemy of a well-scaled web-app is performance variance. Server response times that are unpredictable or unevenly distributed require more servers to scale, even when average response times are unaffected. On a weekly basis, check in on your 5 slowest controller actions. NewRelic provides this metric for you. Treat each of those 5 slow transactions as a bug and try to close it out before the e
@tinogomes
tinogomes / pre-commit-complete
Last active March 24, 2021 13:59
Git Hook pre-commit to pass Rubocop and Brakeman on Rails application for validations
#!/bin/sh
#
# Check for ruby style errors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
NC='\033[0m'
if git rev-parse --verify HEAD >/dev/null 2>&1