Env | Encrypted file | Secret key path | Command |
---|---|---|---|
Generic | config/credentials.yml.enc |
config/master.key |
rails credentials:edit |
Development | config/credentials/development.yml.enc |
config/credentials/development.key |
rails credentials:edit --environment development |
Test | config/credentials/test.yml.enc |
config/credentials/test.key |
rails credentials:edit --environment test |
Staging | config/credentials/staging.yml.enc |
config/credentials/staging.key |
rails credentials:edit --environment staging |
Production | config/credentials/production.yml.enc |
config/credentials/production.key |
`rails credentials:e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "io/console" | |
COLORS = { | |
black: 0, | |
red: 31, | |
green: 32, | |
blue: 34 | |
} | |
loop do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require "httparty" | |
class Converter | |
def initialize(filename) | |
@content = File.open(filename).read | |
end | |
attr_reader :content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Two possibilities to parse a Postgres DB URL from heroku into environment variables | |
# that Spring Boot understands. | |
# You would need that, if you do not build on heroku but push docker images | |
# from another source | |
# Does not need bash. Works on alpine linux / busybox. Tested with openjdk:8-jdk-alpine base image. | |
export DATABASE_URL=postgres://user:password@host:port/database | |
# Naive way, would break with [@:/] in username or password. | |
DB_TYPE=$(echo $DATABASE_URL | awk -F'[:@/]' '{print $1}')"ql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', () => { | |
const uri = URI(window.location.href); | |
const cookieName = uri.path() + '-auth'; | |
const authParam = uri.query(true)['auth']; | |
const wbp = document.querySelector('head meta[name=wbp]').content; | |
if (isUserAuthenticated()) { | |
document.querySelector('body').setAttribute('style', ''); // Show page | |
} else { | |
if (checkWBP()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'sqlite3' | |
gem 'uuidtools' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ./certbot-auto certonly --manual -d 'example.com' -d '*.example.com' --agree-tos --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p style="text-align: justify;">Sem dúvida, uma pergunta que recebo recorrentemente é: "Fernando, como ser um bom desenvolvedor?". Obviamente que não existe uma fórmula mágica, vou compartilhar um pouco do que aplico na minha vida e espero que você consiga bons resultados.</p> | |
<h3><strong>Código limpo</strong></h3> | |
<p style="text-align: justify;">Código limpo consiste basicamente em fazer exatamente o que o título diz: ter um código limpo. <strong>Código é como uma piada, se você tem que explicar, não é tão boa assim</strong>. Até mesmo um código ruim pode funcionar, e - acredite - eu vivo isso no meu dia a dia, tendo que manter um código funcionando que foi escrito por pessoas sem conhecimentos básicos da plataforma Salesforce. Por exemplo, muitas das <em>Triggers</em> que existem na plataforma hoje não são capazes de trabalhar com <strong><em>Bulk Insert</em></strong>. Eu sei que é triste, tem horas que chega a dar vontade de chorar, mas faz parte do nosso mundo de desenvolvimento e você nunca vai encontra |
https://www.youtube.com/playlist?list=PL9_jjLrTYxc3hxsmj3AnPFf3RD4f3zfUl
https://www.youtube.com/watch?v=V8Sdg25eKlM
Ele fala sobre passado, presente e futuro do Ruby, mostrando bastante coisas do dry-rb.
NewerOlder