Skip to content

Instantly share code, notes, and snippets.

View sebasmrl's full-sized avatar
🎯
Focusing

Sebastian Morales sebasmrl

🎯
Focusing
View GitHub Profile
@sebasmrl
sebasmrl / useForm.ts
Last active August 9, 2024 14:26
Custom Hook for manage forms in React
import { ChangeEvent, FormEvent, useState } from "react";
/**
*
* @param initialState
* @returns '{ formData, handleChange, handleSubmit }'
* @author 'Sebastian Morales'
* @description 'useForm es un hook para trabajar con formularios sin importar el numero de entradas,
@sebasmrl
sebasmrl / legible_format.dart
Created August 9, 2024 17:44
Esta clase contiene un metodo estático para formatear numeros extensos a strings legibles de forma amigable con los usuarios, Ej: 143.790 -> 143.7K, 2.250.000 -> 2.2M
Map<int, String> _shortNotationNumbers = {
1: 'K',
2: 'M',
3: 'B',
4: 'T'
};
/// @author Sebastian Morales;
class LegibleFormat{