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
@kiritocode1
kiritocode1 / begin(C++).md
Created October 6, 2021 04:48 — forked from johnmcfarlane/begin(C++).md
Resources for C++ beginners
@kiritocode1
kiritocode1 / .tsx
Created January 14, 2024 10:21
Infinite Scrolling lol
"use client";
import { Card , Image } from "@nextui-org/react";
import { gsap } from "gsap";
import localFont from "next/font/local";
import { Projects, colour , ProjectShow} from "@/lib/Projects";
import { useGSAP } from "@gsap/react";
import { Observer, ScrollTrigger } from "gsap/all";
import React , {
useState,useEffect
@kiritocode1
kiritocode1 / .ts
Last active January 16, 2024 19:14
0$ Ai project
//? npm i @huggingface/inference
//? npm i --save-dev dotenv
//? get the api key from here : https://huggingface.co/settings/tokens
// 💖 written by Aryan Kathawale :)
import { HfInference } from "@huggingface/inference";
import { config } from "dotenv";
@kiritocode1
kiritocode1 / youtube-video-efffect.tsx
Last active September 22, 2024 07:21
replicating youtube effect in a speedrun : 2 hrs
"use client";
import { FC, useEffect, useRef } from "react";
interface pageProps {}
const Page: FC<pageProps> = ({}) => {
return (
<div className="flex min-h-screen bg-black relative items-center justify-center min-w-full">
<video
className="w-[600px] max-w-full h-auto absolute z-20 translate-x-1/2 translate-y-[60%] scale-[1.5_1.3] rounded-[30%] blur-[100px] saturate-200 opacity-50"
@kiritocode1
kiritocode1 / r2-sdk-v3.ts
Created September 30, 2024 17:28
cloudflare
import { GetObjectCommand, GetObjectCommandOutput, S3Client, ListObjectsV2Command , S3 } from "@aws-sdk/client-s3";
import "dotenv/config";
import fs from "node:fs";
import path from "path";
import {Writable} from "stream"
const { AccessKeyId, SecretAccessKey, S3ClientLink } = process.env;
if (!AccessKeyId || !SecretAccessKey || !S3ClientLink) throw new Error("Missing environment variables");
class S3Handler {
//! blog.localhost:3000/ -> hidden(localhost:3000/articles)
//? subdomain.vercel.app -> hidden(vercel.app/{subdomain})
import { NextRequest, NextResponse } from "next/server";
// @ts-nocheck
"use client";
import { useRef, useState } from 'react'
import { motion } from 'framer-motion';
export default function MagneticFramer({children}) {
const ref = useRef(null);
const [position, setPosition] = useState({x:0,y:0});
const handleMouse = (e) => {
const { exec } = require("child_process");
const express = require("express");
const fs = require("fs");
const app = express();
const port = 3000;
app.get("/download", (req, res) => {
const url = "https://youtu.be/2guKYgtji84?si=_nfFhIHseFgIvJza";
const sanitizedTitle = "video";
const outputFile = `${__dirname}/${sanitizedTitle}`;
// --- Day 2: Red-Nosed Reports ---
// Fortunately, the first location The Historians want to search isn't a long walk from the Chief Historian's office.
// While the Red-Nosed Reindeer nuclear fusion/fission plant appears to contain no sign of the Chief Historian, the engineers there run up to you as soon as they see you. Apparently, they still talk about the time Rudolph was saved through molecular synthesis from a single electron.
// They're quick to add that - since you're already here - they'd really appreciate your help analyzing some unusual data from the Red-Nosed reactor. You turn to check if The Historians are waiting for you, but they seem to have already divided into groups that are currently searching every corner of the facility. You offer to help with the unusual data.
// The unusual data (your puzzle input) consists of many reports, one report per line. Each report is a list of numbers called levels that are separated by spaces. For example:
// 7 6 4 2 1
// --- Day 3: Mull It Over ---
// "Our computers are having issues, so I have no idea if we have any Chief Historians in stock! You're welcome to check the warehouse, though," says the mildly flustered shopkeeper at the North Pole Toboggan Rental Shop. The Historians head out to take a look.
// The shopkeeper turns to you. "Any chance you can see why our computers are having issues again?"
// The computer appears to be trying to run a program, but its memory (your puzzle input) is corrupted. All of the instructions have been jumbled up!
// It seems like the goal of the program is just to multiply some numbers. It does that with instructions like mul(X,Y), where X and Y are each 1-3 digit numbers. For instance, mul(44,46) multiplies 44 by 46 to get a result of 2024. Similarly, mul(123,4) would multiply 123 by 4.
// However, because the program's memory has been corrupted, there are also many invalid characters that should be ignored, even if they look like part of a mul instruction. Sequences like mul(4*,