Skip to content

Instantly share code, notes, and snippets.

View adnanalbeda's full-sized avatar

Adnan AlBeda adnanalbeda

View GitHub Profile
@adnanalbeda
adnanalbeda / dashboard-v1.1.html
Last active July 16, 2026 21:47
Mother of Dashboards
<div
class="flex h-screen min-h-0 w-screen min-w-0 flex-row-reverse gap-4 bg-black p-4 font-mono text-white"
>
<div class="flex min-h-0 min-w-0 grow flex-col gap-4 bg-white p-4">
<header class="flex flex-row justify-between gap-4 bg-black p-4">
<div>COMPANY</div>
<nav>
<ul class="flex flex-row items-center gap-4">
<li>-&gt; Link 1</li>
<li>-&gt; Link 2</li>
@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 };
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 / 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)
{
@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 / multiDialog.tsx
Last active September 7, 2025 21:47
React-RadixUI
import {
Children,
cloneElement,
createContext,
useCallback,
useContext,
useMemo,
useState,
} from "react";
import { Slot, SlotProps } from "@radix-ui/react-slot";
import flattenColorPalette from "tailwindcss/lib/util/flattenColorPalette";
import plugin from "tailwindcss/plugin";
const scrollGradientPlugin = plugin(
({ addUtilities, theme, e, matchUtilities }) => {
addUtilities({
".scroll-gradient-y": {
/* variants */
/* size */
"--tw-scroll-gradient-size": "8px",
@adnanalbeda
adnanalbeda / .editorconfig
Last active May 19, 2023 15:43
Mono Repo Configs
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# based on many repos:
# https://github.com/editorconfig/editorconfig/blob/master/.editorconfig
[*]
charset = utf-8 # Set default charset
indent_style = space
@adnanalbeda
adnanalbeda / debounce.ts
Last active March 4, 2023 18:39
Vanilla TS Utils
// limit execution of a function to one per x amount of time to the last interaction.
// Set 'immediate' to true to run the function then it waits for x time of no interaction.
// Keep it undefined or false for default behavior, which is to execute after x time no interaction.
export default function debounce(
func: () => void,
wait: number,
immediate?: boolean
) {
// 'private' variable for instance
// The returned function will be able to reference this due to closure.
@adnanalbeda
adnanalbeda / JSXChildrenUtils.tsx
Last active August 3, 2023 19:48
React Utility Components
export type XNode = JSX.Element | string | number | boolean | null | undefined;
export type XChild = XNode;
export type XC = XChild;
export type XCs = XChild[] | XChild;
export type ChildrenBuilder<T> = (options: T) => XC;
export type CB<T> = ChildrenBuilder<T>;
export type XC_CB<T> = ChildrenBuilder<T> | XCs;
export function buildChildren<T>(options: T, children?: XC_CB<T>) {