Skip to content

Instantly share code, notes, and snippets.

View Freddyerf's full-sized avatar

Freddy Rondon Freddyerf

  • Rochester, NY
View GitHub Profile
@Zefirrat
Zefirrat / MockDbContextAsynced.cs
Last active September 23, 2024 10:02
DbContext helper for moq/mocks with IAsyncQueryable support and easy DbSet mocking
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
@Freddyerf
Freddyerf / validar_cedula.py
Last active September 13, 2022 14:55
Validación de cédula dominicana en Python
"""
Validación de cédula dominicana en Python por: Freddy Rondon
"""
def validar_cedula(cedula):
# La cédula debe tener 11 dígitos
cedula = cedula.replace('-','')
if len(cedula)== 11:
if (int(cedula[0:3]) < 122 and int(cedula[0:3]) > 0 or int(cedula[0:3]) == 402):
suma = 0