- https://illuminatedcomputing.com/talks/rails-and-sql/#generate_series_cte
- http://www.rigelgroupllc.com/blog/2014/09/14/working-with-complex-sql-statements/
- https://til.hashrocket.com/rails
- https://nandovieira.com.br/dica-rapida-3-sanitizando-queries-com-activerecord
- https://hashrocket.com/blog/posts/writable-common-table-expressions#delete-and-archive
- https://hashrocket.com/blog/posts/recursive-sql-in-activerecord
- https://www.ldstudios.co/blog/posts/modeling-postgres-common-table-expressions-and-window-functions-with-rails-and-activerecord
- https://github.com/shmay/ctes_in_my_pg
- https://github.com/DavyJonesLocker/postgres_ext
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
# 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 |
"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:/ |
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 |
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
- 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.
- 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
#!/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 |