Skip to content

Instantly share code, notes, and snippets.

View luga97's full-sized avatar
🎯
Focusing

Luis David Garcia Lunar luga97

🎯
Focusing
View GitHub Profile
@dabydat
dabydat / custom-dates.ts
Created January 22, 2025 17:16
You will find two function in this gist. The first one you will validate if the date that is passing by is correct. The second one is for format the date, you must send the format of the date and the format you finally want and obviously the value of the date you want to format
type Format = 'YYYYMMDD' | 'MMDDYYYY' | 'DDMMYYYY';
const isValidDate = (value: string, format: Format): boolean => {
const DATEFORMAT =
format == 'YYYYMMDD'
? /^([12]\d{3})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/
: format == 'MMDDYYYY'
? /^(0?[1-9]|1[0-2])\/(0?[1-9]|[1-2][0-9]|3[01])\/\d{4}$/
: /^(0?[1-9]|[1-2][0-9]|3[01])\/(0?[1-9]|1[0-2])\/\d{4}$/;
const isValid = value.match(DATEFORMAT);
@HOllarves
HOllarves / Bancos.json
Last active November 8, 2021 15:48
Bancos de venezuela
{
"100%BANCO": "0156",
"ABN-AMRO-BANK": "0196",
"BANCAMIGA-BANCO-MICROFINANCIERO": "0172",
"BANCO-ACTIVO-BANCO-COMERCIAL": "0171",
"BANCO-AGRICOLA": "0166",
"BANCO-BICENTENARIO": "0175",
"BANCO-CARONI-BANCO-UNIVERSAL": "0128",
"BANCO-DE-DESARROLLO-DEL-MICROEMPRESARIO": "0164",
"BANCO-DE-VENEZUELA": "0102",
@mrmans0n
mrmans0n / Adder.java
Created May 9, 2013 08:40
Demostración simple de callbacks en java, con un programa que hace sumas
public class Adder {
private OnMathOperationPerformed onMathOperationPerformed;
private int a, b;
public Adder(int a, int b) {
this.a = a;
this.b = b;
}