Skip to content

Instantly share code, notes, and snippets.

View caioagiani's full-sized avatar
💼
Working at home

Caio Agiani caioagiani

💼
Working at home
View GitHub Profile
SELECT
j.JobID,
j.EmailName,
j.DeliveredTime AS SendTime,
o.EventDate AS EventTime,
s.EmailAddress,
s.SubscriberKey,
'Opened' AS EventType
FROM [_Job] j
INNER JOIN [_Open] o ON j.JobID = o.JobID
#!/bin/bash
# chmod +x gitlab-environments.sh
# ./gitlab-environments.sh <ID>
if [ -z "$1" ]; then
echo "Uso: $0 <ID do Projeto>"
exit 1
fi
server {
listen *:80;
listen *:443 ssl http2;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:30m;
ssl_session_timeout 10m;
ssl_certificate /home/cloudflare/cer.crt;
import psycopg2
from tqdm import tqdm
db_config = {
'dbname': 'levante_web',
# 'user': 'seu_usuario',
# 'password': 'sua_senha',
'host': 'localhost',
'port': '5432'
}
function getFonts() {
const fontArray = [
"sans-serif-thin",
"ARNO PRO",
"Agency FB",
"Arabic Typesetting",
"Arial Unicode MS",
"AvantGarde Bk BT",
"BankGothic Md BT",
"Batang",
@caioagiani
caioagiani / rails http status codes
Created June 1, 2023 16:38 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
tables_and_columns = []
ActiveRecord::Base.connection.tables.count
ActiveRecord::Base.connection.tables.each do |table_name|
count = ActiveRecord::Base.connection.columns(table_name).count
tables_and_columns << { table_name: table_name, column_count: count }
end
tables_and_columns.sort_by! { |tc| tc[:table_name] }
tables_and_columns.each { |tc| puts "#{tc[:table_name]}, #{tc[:column_count]}" }
@caioagiani
caioagiani / upgrade.md
Created December 15, 2022 23:20 — forked from zulhfreelancer/upgrade.md
How to upgrade Heroku Postgres database plan?
  1. Assuming you have multiple Heroku apps and Git remote like so:
development https://git.heroku.com/xxx.git (fetch)
development https://git.heroku.com/xxx.git (push)
origin      [email protected]:xxx/xxx.git  (fetch)
origin      [email protected]:xxx/xxx.git  (push)
production  https://git.heroku.com/xxx.git (fetch)
production  https://git.heroku.com/xxx.git (push)
staging https://git.heroku.com/xxx.git (fetch)
@caioagiani
caioagiani / commit.md
Created December 7, 2022 13:33
Conventional Commits Pattern

Type: Quais são os tipos de commit

O type é responsável por nos dizer qual o tipo de alteração ou iteração está sendo feita, das regras da convenção, temos os seguintes tipos:

  • test(arquivo): indica qualquer tipo de criação ou alteração de códigos de teste.
    Exemplo: Criação de testes unitários.

  • feat(arquivo): indica o desenvolvimento de uma nova feature ao projeto.
    Exemplo: Acréscimo de um serviço, funcionalidade, endpoint, etc.

  • refactor(arquivo): usado quando houver uma refatoração de código que não tenha qualquer tipo de impacto na lógica/regras de negócio do sistema.

@caioagiani
caioagiani / README.md
Created November 15, 2022 20:37 — forked from diego3g/README.md
Criação de servidor Node.js

Configuração do servidor

  1. Configurar chave SSH
  2. Criar Droplet
  3. Realizar update e upgrade
  4. Crua usuário adduser deploy e usermod -aG sudo deploy
  5. Cria pasta .ssh pro deploy
  6. cp ~/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys
  7. chown -R deploy:deploy .ssh/
  8. chmod 700 .ssh