Skip to content

Instantly share code, notes, and snippets.

View guidani's full-sized avatar
👾
Focusing

Guilherme Daniel guidani

👾
Focusing
View GitHub Profile
@guidani
guidani / email_validation_regex.md
Created August 11, 2022 10:34
Regex for email validation

\A(?:[a-z0-9!#$%&'+/=?^_‘{|}~-]+(?:.[a-z0-9!#$%&'+/=?^_‘{|}~-]+)* | "(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f] | \[\x01-\x09\x0b\x0c\x0e-\x7f])") @ (?:(?:a-z0-9?.)+a-z0-9? | [(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3} (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-][a-z0-9]: (?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f] | \[\x01-\x09\x0b\x0c\x0e-\x7f])+) ])\z

@guidani
guidani / bash_zsh.md
Created May 26, 2022 22:15
Como alternar entre shell zsh e bash

-> Instalar zsh ubuntu: sudo apt install zsh -> which zsh para ver o local de instalação do zsh /usr/bin/zsh -> which bash para ver o local de instalação do bash /usr/bin/bash

chsh -> para alternar o shell padrão, será solicitado o caminho do outro shell, só colocar e fechar o terminal.

@guidani
guidani / index.tsx
Created February 10, 2022 18:55
Lost focus on input
import React, { useState } from "react";
interface IProducts {
code: string;
description: string;
price?: number;
key: number;
}
export const Products = () => {
@guidani
guidani / date-formatter.md
Created February 8, 2022 18:16
converter data com javascript

Passo 1:

  • Instanciar um novo objeto de data com Date() passando um template básico:

const date = new Date("2022-01-25 00:00")

Passo 2:

  • Localizar a nova data para o local do usuário: const actual = date.toLocaleString("pt-br", {year: "numeric", month: "long", day: "numeric"})
@guidani
guidani / deply-react-app-in-githubpages.md
Created February 8, 2022 16:13
How to deplay a react app with github pages

Passo 0

  • Subir o projeto para um repositório no github.

Passo 1

  • instalar a dependencia: yarn add -D gh-pages.

Passo 2

  • Alterar o arquivo package.json adicionando as seguintes linhas:
{
@guidani
guidani / countdownTimer.js
Created January 14, 2022 13:54
Countdown Timer with Javascript
let actualTime = 10;
function timer(){
const setTime = setInterval(
() => {
console.log(actualTime)
actualTime--
if (actualTime < 0){
clearInterval(setTime);
console.log('END')
@guidani
guidani / flip-card-profile.markdown
Created December 28, 2021 20:57
Flip Card Profile
@guidani
guidani / flip-card.markdown
Created December 28, 2021 19:44
Flip Card
@guidani
guidani / forca.py
Created October 22, 2021 19:37
jogo da forca em python
def main():
palavras_chutadas = []
tela = cria_exibicao()
total_tentativas = 6
acertou_palavra = False
forca = False
while not forca and not acertou_palavra:
print('-'*30)
chute = input('Chute: ')