Skip to content

Instantly share code, notes, and snippets.

View DevFullStack-Franklyn-R-Silva's full-sized avatar
:copilot:
Clean code

Franklyn Roberto DevFullStack-Franklyn-R-Silva

:copilot:
Clean code
View GitHub Profile
@adrianoluis
adrianoluis / DocumentUtil.java
Last active November 3, 2025 19:33
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 sum(int[] weight, char[] numbers, int length) {
if (length <= 0) return 0;
@luizomf
luizomf / README.md
Last active February 6, 2025 14:18
VSCode settings.json - keybindings.json - recomendations - extensions.json. Just to backup (visual studio code)