Skip to content

Instantly share code, notes, and snippets.

View felipecarvalho's full-sized avatar
🎯
Focusing

Felipe Carvalho felipecarvalho

🎯
Focusing
View GitHub Profile
@felipecarvalho
felipecarvalho / main.dart
Last active March 11, 2019 00:21
Snippet to check brazilian license plate from vehicles in Dart language
// Created by Felipe Carvalho [http://github.com/felipecarvalho]
// You can play with this code on DartPad [https://dartpad.dartlang.org/1d41821144a1645428ff4a3000d5d74a]
void main() {
String _regOldPlate = r"^[a-zA-Z]{3}[-][0-9]{4}$";
String _regNewPlate = r"^[a-zA-Z]{3}[0-9]{1}[a-zA-Z]{1}[0-9]{2}$";
RegExp _currentPlate;
void checkNewPlate(bool _value, String _plate) {
_currentPlate = RegExp(_value ? _regNewPlate : _regOldPlate, caseSensitive: false, multiLine: false);
@felipecarvalho
felipecarvalho / codes.json
Last active February 26, 2023 17:09
JSON list with country and phone codes in portuguese [PT-BR]
[
{
"dialCode": "93",
"code": "AFG",
"label": "Afeganistão"
},
{
"dialCode": "355",
"code": "ALB",
"label": "Albânia"