Skip to content

Instantly share code, notes, and snippets.

View adnanalbeda's full-sized avatar

Adnan AlBeda adnanalbeda

View GitHub Profile
@adnanalbeda
adnanalbeda / README.md
Last active May 27, 2024 01:06
Zod Utils

Zod Utils

Zod is a great library for shaping and validating data. So away from the long introductory, it misses few feature.

People tried to fix its issues with extended libraries.

But since some are not maintained or didn't meet my criteria, here's my fine-tuned version of them.

@adnanalbeda
adnanalbeda / Exception.cs
Last active August 15, 2024 10:50
Google ReCaptcha V3 - ASP API - C#
namespace Google.ReCaptcha.V3;
public class CaptchaRequestException : Exception
{
public CaptchaRequestException()
{
}
public CaptchaRequestException(string message)
: base(message)
{
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Microsoft.EntityFrameworkCore;
public static partial class UuidConverterExtensions
{
private static Action<PropertiesConfigurationBuilder<Uuid>> defaultValueDelegate = (_) => { };
private static Action<PropertiesConfigurationBuilder<Uuid?>> defaultNullableValueDelegate = (
_
) => { };
@adnanalbeda
adnanalbeda / effect.ts
Last active January 28, 2025 10:05
reactivity-vanillaJS
import { SignalGet, SignalUnsubscribe } from "./signal";
export type EffectDepsValues<T extends SignalGet<unknown>[]> = {
[k in keyof T]: T[k] extends SignalGet<infer R> ? R : never;
};
export type EffectCallback<
T extends [SignalGet<unknown>, ...SignalGet<unknown>[]]
> = (values: EffectDepsValues<T>) => unknown;
export type EffectCleanup = { (): void; isExecuted(): boolean };