Skip to content

Instantly share code, notes, and snippets.

View kiritocode1's full-sized avatar
🪄
Abra Cadabra

Aryan Kathawale kiritocode1

🪄
Abra Cadabra
View GitHub Profile
"use client"
import React from "react"
import { useRef, useEffect, useCallback, useState, type HTMLAttributes } from "react"
import { cn } from "@/lib/utils"
// Constants for wave animation behavior
const WAVE_THRESH = 6
const CHAR_MULT = 2
@kiritocode1
kiritocode1 / am-i-ahead-of-jarred-sumner.ts
Last active January 22, 2026 14:59
am I ahead of Jarred Sumner
import { Effect, Schema, Console } from "effect";
import {
FetchHttpClient,
HttpClient,
HttpClientRequest,
HttpClientResponse,
} from "@effect/platform";
// ============================================================================
// Custom Errors (Effect best practice - use tagged errors)
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run `zed: open default settings` from the
// command palette (cmd-shift-p / ctrl-shift-p)
{
"buffer_font_family": "Monaspace Krypton",
@kiritocode1
kiritocode1 / P&C.cpp
Last active September 12, 2025 07:14
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
// Function to calculate factorial
long long factorial(int n) {
if (n <= 1) return 1;
long long result = 1;
@kiritocode1
kiritocode1 / Howto.md
Last active September 5, 2025 05:48
How to add Accessibility In any next app

1. Setup Next themes

https://www.npmjs.com/package/next-themes

2. once next themes is setup , test it out .... checkout a theme switcher , ask claude to make one for your next version .

3. Add this use-screen-reader.js hook , to a folder to use it in main component

@kiritocode1
kiritocode1 / somehowitworks.ts
Created August 16, 2025 18:50
somehowitworks.ts
import { Config, Console, Effect, Layer, Schema } from "effect";
import { Prompt } from "@effect/cli";
import { AiChat, AiTool, AiToolkit } from "@effect/ai";
import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic";
import { BunContext, BunRuntime } from "@effect/platform-bun";
import * as FetchHttpClient from "@effect/platform/FetchHttpClient";
import {OpenAiClient, OpenAiLanguageModel} from "@effect/ai-openai"
import { Effect ,Data} from "effect";
import { Schema } from "@effect/schema";
interface Todo{
id: number;
title: string;
}
const TodosSchema = Schema.Array(
Schema.Struct({
@kiritocode1
kiritocode1 / next-3d.tsx
Last active July 23, 2025 05:40
3d scene in VR
"use client";
import React, { useRef, useState, useMemo } from "react";
import { Canvas, useFrame } from "@react-three/fiber";
import { XR, VRButton, useXR, createXRStore } from "@react-three/xr";
import { OrbitControls, Text } from "@react-three/drei";
import { Mesh } from "three";
// Animated cube component
function AnimatedCube({ position, color = "orange" }: { position: [number, number, number]; color: string }) {
const meshRef = useRef<Mesh>(null);
// --- Day 9: Disk Fragmenter ---
// Another push of the button leaves you in the familiar hallways of some friendly amphipods! Good thing you each somehow got your own personal mini submarine. The Historians jet away in search of the Chief, mostly by driving directly into walls.
// While The Historians quickly figure out how to pilot these things, you notice an amphipod in the corner struggling with his computer. He's trying to make more contiguous free space by compacting all of the files, but his program isn't working; you offer to help.
// He shows you the disk map (your puzzle input) he's already generated. For example:
// 2333133121414131402
// The disk map uses a dense format to represent the layout of files and free space on the disk. The digits alternate between indicating the length of a file and the length of free space.
const Raw = `....h.....Q..............Y........................
...............................Y........C.........
...............m..........x................B......
........................Y..............qB.........
......g4.........................h..Y.....q...c...
................n.....R...........................
.......................................w........5.