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
package.json | |
{ | |
"name": "config", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"type": "module", | |
"scripts": { | |
"test": "npx jest --runInBand test/", | |
"test:dev": "npx jest --runInBand --watchAll test/", |
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
https://precisoestudarsempre.blogspot.com/2013/08/regex-para-aceitar-acentos.html | |
[A-Za-zà-úÀ-Ú] |
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
https://stackoverflow.com/a/76526810/11842937 | |
https://codesandbox.io/p/sandbox/boring-platform-gpmnd9?file=%2Fsrc%2FApp.tsx%3A38%2C15&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clpbg1hi700072a67brbvi1bu%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%25 |
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
https://stackoverflow.com/questions/73695535/how-to-check-confirm-password-with-zod | |
https://github.com/colinhacks/zod#superRefine | |
export const registerUserSchema = z.object({ | |
firstName: z.string(), | |
lastName: z.string(), | |
userName: z.string(), | |
email: z.string().email(), | |
phone: z.string().transform(data => Number(data)), | |
password: z.string().min(4), |
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
https://docs.github.com/pt/repositories/working-with-files/managing-large-files/about-large-files-on-github | |
Open Git Bash. | |
Change the current working directory to your local repository. | |
To remove the file, enter git rm --cached: |
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
Error: | |
const stringWidth = require('string-width'); | |
^ | |
.../node_modules/cli-table3/src/utils.js not supported. | |
How to solve: | |
delete yarn.lock and install packages again |
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 url = 'https://valchan.com.br/static/59fef712836ff3c9af18106e6daea978/3554d/valchan.webp' | |
const imageName = url.split('/').pop().split('.').shift() | |
const imageName2 = url.split('/').pop().replace(/\.[^/.]+$/, "") | |
console.log(imageName) // valchan | |
console.log(imageName2) // valchan |
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
// with undici | |
const getBase64FromUrl = async (url) => { | |
const response = await fetch(url) | |
const arrayBuffer = await response.arrayBuffer() | |
const base64 = Buffer.from(arrayBuffer)toString('base64') | |
return base64 | |
} | |
// without undici |
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
values = [ | |
{ | |
'title': 'A', | |
'desc': 'Desc A' | |
}, | |
{ | |
'title': 'B', | |
'desc': 'Desc B' | |
}, | |
{ |
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
https://askubuntu.com/questions/21555/command-to-append-line-to-a-text-file-without-opening-an-editor | |
Append a line of text to a file by using the >> operator: | |
echo "hello world" >> my_file.txt | |