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
@echo off | |
powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr -useb https://raw.githubusercontent.com/spicetify/cli/main/install.ps1 | iex" | |
powershell -ExecutionPolicy Bypass -Command "iwr -useb https://raw.githubusercontent.com/spicetify/marketplace/main/resources/install.ps1 | iex" | |
pause |
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
import { useEffect, useState } from 'react' | |
export function useDebounceValue<T = unknown>(value: T, delay: number) { | |
const [debouncedValue, setDebouncedValue] = useState(value) | |
useEffect(() => { | |
const handler = setTimeout(() => { | |
setDebouncedValue(value) | |
}, delay) |
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
Show hidden characters
{ | |
"Generate React Page": { | |
"prefix": "genreactpage", | |
"body": [ | |
"export default function ${1:PageName}() {", | |
" return (", | |
" <div>", | |
" <h1>${1:PageName}</h1>", | |
" </div>", | |
" );", |
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
{ | |
// EDITOR | |
"editor.fontSize": 14, | |
"editor.fontFamily": "JetBrains Mono", // CaskaydiaCove Nerd Font | |
"editor.fontLigatures": true, | |
"editor.fastScrollSensitivity": 5, | |
"editor.padding.bottom": 30, | |
"editor.wordWrap": "on", | |
"editor.linkedEditing": true, | |
"editor.lineHeight": 20, |
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
const cpf = "12345678900"; | |
function maskCpf(cpf) { | |
maskedCpf = cpf | |
.replace(/\D/g, '') | |
.replace(/(\d{3})(\d{3})(\d{3})(\d)/, '$1.$2.$3-$4') | |
return maskedCpf; | |
} |
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
const phoneNumber = "99988663355"; | |
function maskPhone(phone) { | |
if (phone.length == 10) { | |
const stringValue = phone.toString(); | |
const maskedPhone = stringValue | |
.replace(/\D/g, '') | |
.replace(/(\d{2})(\d)/, '($1) $2') | |
.replace(/(\d{4})(\d{4})/, '$1-$2'); | |
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
const message = new SpeechSynthesisUtterance(); | |
mensagem.text = 'Good night, Bruno!'; | |
window.speechSynthesis.speak(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
import React from "react"; | |
import { useModal } from "../../contexts/modalContext"; | |
type ModalProps = { | |
children: React.ReactNode; | |
modalButton: React.ReactElement; | |
}; | |
export function ReactModal({ children, modalButton }: ModalProps) { | |
const { isOpen, setIsOpen } = useModal(); |
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
const [data, setData] = useState([ | |
{id: 1, country: 'Austria'}, | |
{id: 2, country: 'Belgium'}, | |
{id: 3, country: 'Canada'}, | |
]); | |
const updateState = () => { | |
setData(prevState => { | |
const newState = prevState.map(obj => { | |
if (obj.id === 2) { |
NewerOlder