Skip to content

Instantly share code, notes, and snippets.

View kauemorelli's full-sized avatar

Kauê Morelli kauemorelli

View GitHub Profile
@imaginamundo
imaginamundo / Regex telefone Brasil.md
Last active April 6, 2024 22:46
Regex para padrões de telefones brasileiros com explicação e como usar

Regex para telefones do Brasil

(?:(^\+\d{2})?)(?:([1-9]{2})|([0-9]{3})?)(\d{4,5})(\d{4})

Pequena explicação

  • (?:(^\+\d{2})?)

    • Busca por um + seguido por dois números, opcional.
  • (?:([1-9]{2})|([0-9]{3})?)

  • Busca por dois números de 1 à 9, ou três números de 0 à 9, isso faz a diferença entre o DDD com zero e DDD sem zero, lembrando que nenhum código de cidade tem o digito 0. Também opcional.

@heiswayi
heiswayi / repo-reset.md
Created February 5, 2017 01:32
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A