Skip to content

Instantly share code, notes, and snippets.

View ryands17's full-sized avatar
:electron:
In love with TS & Rust

Ryan Dsouza ryands17

:electron:
In love with TS & Rust
View GitHub Profile
@ryands17
ryands17 / tut.md
Last active July 15, 2024 15:28 — forked from ikouchiha47/tut.md
Implementing a peer to peer chat prototype in nodejs.

prologue

Why another tutorial? Because there are other tutorials which write a server - client or maybe a client client where they have only two clients, maybe by hardcoding ips.

<rant>
  What annoys me more is, that there are 100's of same tutroials on the internet, 
 that just works for a given scenario, but guess what, I don't fucking care what works
@ryands17
ryands17 / useForm.ts
Created March 5, 2023 19:03 — forked from danieljpgo/useForm.ts
react-hook-form + zod
import {
useForm as useHookForm,
UseFormProps as useHookFormProps,
} from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { TypeOf, ZodSchema } from "zod";
interface UseFormProps<Z extends ZodSchema>
extends Exclude<useHookFormProps<TypeOf<Z>>, "resolver"> {
schema: Z;