This file contains hidden or 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
| begin | |
| for deleta in (select table_name, 'DROP TABLE '||table_name||' cascade constraints' AS dropar from user_tables) loop | |
| BEGIN | |
| EXECUTE IMMEDIATE deleta.dropar; | |
| dbms_output.put_line('DROP TABLE '||deleta.table_name||' cascade constraints;'); | |
| EXCEPTION WHEN OTHERS THEN | |
| dbms_output.put_line('Erro ao tentar dropar a tabela:'||deleta.table_name); | |
| END; | |
| end loop; | |
| end; |
This file contains hidden or 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
| ########################################### | |
| where pt 1 | |
| ########################################### | |
| Transfer.where(amount_cents: 1500) | |
| O Active Records cria cláusulas IN na consulta SQL quando passamos um array de valores | |
| Transfer.where(amount_cents: [1000, 1500, 2000]) #SELECT "products".* FROM transfers WHERE "transfer.amount_cents" IN (100, 150, 200) |
This file contains hidden or 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
| #!/bin/bash | |
| #--------------------------------------------------------------------------------------- | |
| # Script to install rbenv, Ruby, nodejs and yarn | |
| # Source: https://gist.github.com/alexishida/655fb139c759393ae5fe47dacd163f99 | |
| # | |
| # Author: Alex Ishida <alexishida@gmail.com> | |
| # Version: 1.5.6 - 28/06/2022 | |
| #--------------------------------------------------------------------------------------- | |
| # | |
| # HOW TO INSTALL A SCRIPT |
This file contains hidden or 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
| rails db:migrate VERSION=20211006171023 | |
| rails db:migrate:up VERSION=20211006171023 | |
| rails db:migrate:down VERSION=20211006171023 | |
| rails db:rollback STEP=1 |
This file contains hidden or 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
| # Ubuntu 21.10 Impish Indri | |
| sudo apt update | |
| sudo apt install postgresql postgresql-contrib | |
| sudo -i -u postgres | |
| psql | |
| CREATE USER lucas WITH PASSWORD '12345678' CREATEDB; | |
| ALTER USER postgres PASSWORD postgres; |
This file contains hidden or 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
| git config --global color.ui true | |
| git config --global user.name "Thalescantai" | |
| git config --global user.email "tcantai54@gmail.com" | |
| ssh-keygen -t rsa -b 4096 -C "tcantai54@gmail.com" | |
| cat ~/.ssh/id_rsa.pub |
This file contains hidden or 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
| # encoding: UTF-8 | |
| # pt-BR translations for Devise | |
| pt-BR: | |
| devise: | |
| confirmations: | |
| confirmed: "Sua conta foi confirmada com sucesso. Você está logado." | |
| send_instructions: "Dentro de minutos, você receberá um e-mail com instruções para a confirmação da sua conta." | |
| send_paranoid_instructions: "Se o seu endereço de e-mail estiver cadastrado, você receberá uma mensagem com instruções para confirmação da sua conta." | |
| failure: | |
| already_authenticated: "Você já está logado." |
This file contains hidden or 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
| git config --global user.name "Robson Cavalcante" | |
| git config --global user.email robsxncavalcante@gmail.com | |
| git config --global core.editor "vim" | |
| # CREATE THE SSH KET | |
| ssh-keygen -t rsa -b 4096 -C "robsxncavalcante@gmail.com" | |
| # INITIALING SSH-AGENT IN THE BACKGROUND | |
| eval "$(ssh-agent -s)" |
This file contains hidden or 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
| # HOW TO INSTALL RBENV AND RUBY ON UBUNTUh | |
| sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev | |
| curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash | |
| echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
| echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
| source ~/.bashrc | |
| git clone https://github.com/rbenv/ruby-build.git |
This file contains hidden or 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
| # Version 21.4.0.0.0 (Requires glibc 2.14) | |
| # Instalar a biblioteca | |
| sudo apt-get install libaio1 unzip | |
| # Criar a pasta | |
| sudo mkdir /opt/oracle | |
| # Mover para /opt/oracle | |
| instantclient-basic-linux.x64-21.4.0.0.0.zip | |
| instantclient-sdk-linux.x64-21.4.0.0.0.zip |
NewerOlder