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
| docker compose down -v | |
| docker system prune -af | |
| docker compose up --build |
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
| ## atualiza cash ## | |
| DELETE FROM wp_options WHERE option_name LIKE '_transient_%'; | |
| UPDATE wp_term_taxonomy SET count = ( | |
| SELECT COUNT(1) | |
| FROM wp_term_relationships | |
| WHERE wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id | |
| ); | |
| ## acha categorias ## |
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
| #! /usr/bin/env ruby | |
| require 'nokogiri' | |
| require 'open-uri' | |
| # Fetch and parse HTML document | |
| doc = Nokogiri::HTML(URI.open('https://www.imdb.com/chart/top/?ref_=nv_mv_250')) | |
| table = doc.css('table.chart').css('tbody.lister-list') |
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
| INPORT | |
| import Swal from "sweetalert2" | |
| import * as sweetalert2 from "sweetalert2" | |
| IN BUTTON | |
| <%= button_to "Destroy this post", @post, method: :delete, form_class: 'delete-post' %> | |
| IN JS |
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 |
NewerOlder