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
navs = document.getElementsByTagName('nav')[0].style="display:none"; | |
divs_float_end = document.getElementsByClassName("float-end")[0].style="display:none"; | |
divs_float_start = document.getElementsByClassName("float-start")[0].style="display:none"; |
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 | |
currentHour=$(date +%H) | |
if (( currentHour >= 20 || currentHour < 5 )); then | |
echo "It is between 8 PM and 5 AM" | |
xrandr --output eDP --gamma 1.0:0.7:0.5 | |
else | |
echo "It is outside of 8 PM and 5 AM" | |
fi |
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 | |
echo 'reference: https://www.gnu.org/software/bash/manual/html_node/Aliases#:~:text=Aliases%20are%20not%20expanded%20when%20the%20shell%20is%20not%20interactive%2C%20unless%20the%20expand_aliases%20shell%20option%20is%20set%20using%20shopt%20' | |
shopt -s expand_aliases | |
source ~/.bash_aliases # Or ~/.bashrc | |
alias_name |
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 | |
echo "Count 10 seconds!" | |
for i in $(seq 1 10); do | |
echo -n "$i-" | |
sleep 1 | |
done | |
echo "Done!" |
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 | |
echo "Hello ..." | |
sleep 2 | |
echo "... World! Sorry I fell asleep for 2 seconds!" |
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 | |
dateNow=$(date "+%F-%H-%M-%S") | |
mkdir backup$dateNow |
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 | |
echo "Enter the full directory path: " | |
read dir | |
if [ -d "$dir" ]; then | |
echo "The directory $dir exists." | |
else | |
echo "The directory does not exists." | |
fi |
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 | |
#Geting user data | |
echo 'User name?' | |
read user | |
echo 'Email?' | |
read email | |
echo 'Message?' |
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
/*testando transações*/ | |
delimiter // | |
create procedure insere() | |
begin | |
declare erro tinyint default false; | |
declare continue handler for sqlexception set erro = true;/*Handler é quem ira tratar os erros*/ | |
start transaction; | |
insert into produto(descricao, preco, estoque) values ("cigarro", 20, 4); | |
insert into venda(cliente, data_venda) values ("Josefino", current_timestamp()); |
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
/*Meu primeiro "gatilho" :)*/ | |
/*Ocorre quando o inserirmos uma venda, e o estoque precisa diminuir*/ | |
delimiter // | |
create trigger tgr_venda_item_insert after insert on venda_item | |
for each row | |
begin | |
update produto set estoque = estoque - new.qnt where id = new.id_produto; | |
end; // | |
/*Meu segundo trigger*/ |
NewerOlder