- Show table collation from a database:
show table status from <database>;
- Show collation from an entire database;
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require "httparty" | |
class Converter | |
def initialize(filename) | |
@content = File.open(filename).read | |
end | |
attr_reader :content |
# 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" |
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 |
<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 |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=/var/www/lucascaton_blog |
require 'RMagick' | |
require 'capybara' | |
require 'launchy' | |
module Capybara::Recording | |
def start_recording | |
system "rm -f tmp/*" | |
end | |
def save_recording |
#!/usr/bin/env ruby | |
if `git diff --cached spec` =~ /,\s?(:focus|focus:\s?true|:focus\s?=>\s?true)/ | |
puts "\e[31mPlease focus and remove your :focus tags before committing :)" | |
exit 1 | |
end |
# iPhone 6 Reservation Availability in Australia | |
# !! Please use responsibly. Personal use only !! | |
# `ruby iphone6.rb` - list all available models in all stores | |
# `ruby iphone6.rb R405` - list available models for a specific store, Rundle Place in this example. | |
require 'open-uri' | |
require 'json' | |
MODEL_NAMES = { | |
"MG4A2X/A" => "iPhone 6 Space Grey 128GB", |
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. |