This file contains 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
<div id="myModal" class="modal fade" role="dialog"> | |
<form method="POST" id="addUsuario" enctype="multipart/form-data"> | |
<div class="modal-dialog modal-lg"> | |
<!-- Modal content--> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal">×</button> | |
<h4 class="modal-title">Cadastro de Login SGA</h4> | |
</div> | |
<div class="modal-body"> |
This file contains 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
function getparams(url){ | |
let regex = /[^=\]]+(?=&)/g; | |
// void broken code add a & final url | |
let str = url + '&'; | |
let match = regex.exec(str)[0]; | |
return match | |
} | |
console.log(getparams('https://www.youtube.com/watch?v=z_DNPipPdUA&t=1900s')) | |
console.log(getparams('https://www.youtube.com/watch?v=uzUoGD1G6LU&list=RDuzUoGD1G6LU&start_radio=1&rv=z_DNPipPdUA')) |
This file contains 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
// evita adicionar o mesmo item no carrinho, apenas increment quantidade | |
const cart = [] | |
function addToCart(product){ | |
// get index se o item tem no carrinho | |
const checkCartItem = cart.findIndex(pro => pro.id === product.id) | |
if(checkCartItem > -1){ | |
// item existe apenas increment quant |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" style="color-scheme: dark"> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Chek Age Number</title> | |
</head> | |
<body> | |
<input type="number" /> | |
<p></p> |
This file contains 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
var loadTime = function(){ | |
setTimeout(function(){ | |
var perfData = window.performance.timing; | |
var EstimatedTime = (perfData.loadEventEnd - perfData.navigationStart); | |
console.clear(); | |
console.log(EstimatedTime); | |
console.log(EstimatedTime+" milliseconds"); |
This file contains 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
let [cont,sum,qt] = [1,0,2]; //contador, soma e quantidade de notas | |
while(cont <= qt){ | |
const notas = +prompt(`Digite a nota ${cont}`); | |
if(notas > 10) { alert('nota invalida!'); break; } // verifica se a nota for maior que 10 cancela a operacao | |
sum += (notas) //faz a soma | |
document.write(`Nota ${cont} => ${notas}`); | |
document.write('<br>'); | |
cont++; | |
} |
This file contains 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
// get all questions || or gabarito answers | |
const title = document.querySelectorAll("[data-testid='question-typography']:first-child") | |
for(const i of title){ | |
console.log(i.textContent) | |
console.log("=============") | |
} | |
// get all questions || or gabarito answers com index | |
const title = document.querySelectorAll("[data-testid='question-typography']:first-child") | |
for(const [i, value] of title.entries()){ |
This file contains 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
//first class function | |
const ano = [1992,1995,2000,2006,2008]; | |
function idade(age){ | |
let d = new Date(); | |
return d.getFullYear() - age; | |
} | |
function Calc(ano,fun){ // declarando dois parâmetros, os anos e a função que calcula a idade baseado nos anos | |
let gets = []; // array vazio vai armazerar os resultados |
This file contains 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
const api = "https://gh-pinned-repos.egoist.sh/?username=geraldotech"; | |
loadE = document.querySelector("#loading"); | |
container = document.querySelector("#container"); | |
async function get(url){ | |
response = await fetch(url) | |
console.log(response) | |
data = await response.json(); | |
console.log(data) |
NewerOlder