Skip to content

Instantly share code, notes, and snippets.

View Exclsv's full-sized avatar

Exclsv Exclsv

View GitHub Profile
@Exclsv
Exclsv / phone-input.ts
Created November 20, 2024 17:38 — forked from ramziddin/phone-input.ts
Uzbekistan phone number input component
import { ComponentProps, useState } from "react"
function PhoneInput(props: ComponentProps<"input">) {
const [value, setValue] = useState<string>("+998")
const formattedValue = value
.replaceAll(" ", "") // remove whitespace
.slice(4) // strip the country code
.match(/(\d{1,2})?(\d{1,3})?(\d{1,2})?(\d{1,2})?/)! // split into multiple components
.toSpliced(0, 1, "+998") // replace global match with country code
@Exclsv
Exclsv / GLSL-Noise.md
Created November 3, 2024 19:22 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);