- Modificado (modified);
- Preparado (staged/index)
- Consolidado (comitted);
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
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
charset = utf-8 | |
trim_trailing_whitespace = true | |
insert_final_newline = true | |
end_of_line = lf | |
# editorconfig-tools is unable to ignore longs strings or urls |
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
{ | |
"extends": [ | |
"stylelint-config-standard", | |
"stylelint-a11y/recommended", | |
"stylelint-config-prettier" | |
] | |
} |
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
# Created by https://www.toptal.com/developers/gitignore/api/node,react,dotenv,yarn | |
# Edit at https://www.toptal.com/developers/gitignore?templates=node,react,dotenv,yarn | |
### dotenv ### | |
.env | |
### Node ### | |
# Logs | |
logs |
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 MongoClient = require('mongodb').MongoClient; | |
const uri = "mongodb+srv://masterUser:<password>@myfirstdb.7vxnx.gcp.mongodb.net/<dbname>?retryWrites=true&w=majority"; | |
const client = new MongoClient(uri, { useNewUrlParser: true }); | |
client.connect(err => { | |
const collection = client.db("test").collection("devices"); | |
// perform actions on the collection object | |
client.close(); | |
}); |
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, useRef } from 'react'; | |
import { useHistory, useLocation } from 'react-router-dom'; | |
import { UnregisterCallback } from 'history'; | |
/** | |
* Hook auxiliar. Referência para implementação: | |
* - https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state; | |
* - https://usehooks.com/usePrevious/; |
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
export default (when = false): void => { | |
const onUnload = (event: BeforeUnloadEvent): string => { | |
// garantindo compatibilidade com browser antigos e mobile | |
const listener = event || window.event; | |
listener.preventDefault(); | |
if (listener) { | |
/* compatibilidade com browser engines Gecko (Firefox), | |
Trident(Internet Explorer) e Chrome versões 34+ */ |
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
version: '3' | |
services: | |
videoaulas_db: | |
image: postgres:13-alpine | |
environment: | |
POSTGRES_DB: ${DATABASE_NAME} | |
POSTGRES_USER: ${DATABASE_USERNAME} | |
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} | |
ports: |
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
// retorna se é um número internacional válido | |
const isValidInternationalNumber = (phoneNumber) => { | |
/* regex para validar se é um numero telefonico internacional válido, sinal de '+' opcional e sem extensão (exemplo: 'ramal xxx') | |
referência adaptada: https://stackoverflow.com/questions/16699007/regular-expression-to-match-standard-10-digit-phone-number | |
*/ | |
const phoneNumberRegex = | |
/^(\+\d{1,3}\s)?\(?\d{2,3}\)?[\s.-]?\d{3,5}[\s.-]?\d{4}$/g; | |
return phoneNumberRegex.test(phoneNumber); | |
}; |
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
mkcd() { | |
case "$1" in /*) : ;; *) set -- "./$1" ;; esac | |
mkdir -pv "$1" && cd "$1" | |
} | |
git-update-repo() { | |
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done | |
} |