Skip to content

Instantly share code, notes, and snippets.

View lucassverissimo's full-sized avatar
😎

Lucas Veríssimo Leite lucassverissimo

😎
View GitHub Profile
@lucassverissimo
lucassverissimo / DocumentUtil.java
Created October 8, 2020 00:07 — forked from adrianoluis/DocumentUtil.java
Utility class to validate CPF and CNPJ document types. For CPF use isValidSsn and for CNPJ use isValidTfn. Added to repo https://github.com/adrianoluis/misc-tools
public class DocumentUtil {
// CPF
private static final int[] WEIGHT_SSN = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2};
// CNPJ
private static final int[] WEIGHT_TFN = {6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2};
private static int recursiveSum(int[] weight, char[] chr, int number) {
if (number <= 0) return 0;
@lucassverissimo
lucassverissimo / git.md
Created April 11, 2019 03:07 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda