This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- Day 4: Ceres Search --- | |
// "Looks like the Chief's not here. Next!" One of The Historians pulls out a device and pushes the only button on it. After a brief flash, you recognize the interior of the Ceres monitoring station! | |
// As the search for the Chief continues, a small Elf who lives on the station tugs on your shirt; she'd like to know if you could help her with her word search (your puzzle input). She only has to find one word: XMAS. | |
// This word search allows words to be horizontal, vertical, diagonal, written backwards, or even overlapping other words. It's a little unusual, though, as you don't merely need to find one instance of XMAS - you need to find all of them. Here are a few ways XMAS might appear, where irrelevant characters have been replaced with .: | |
// ..X... | |
// .SAMX. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- Day 1: Historian Hysteria --- | |
// The Chief Historian is always present for the big Christmas sleigh launch, but nobody has seen him in months! Last anyone heard, he was visiting locations that are historically significant to the North Pole; a group of Senior Historians has asked you to accompany them as they check the places they think he was most likely to visit. | |
// As each location is checked, they will mark it on their list with a star. They figure the Chief Historian must be in one of the first fifty places they'll look, so in order to save Christmas, you need to help them get fifty stars on their list before Santa takes off on December 25th. | |
// Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck! | |
// You haven't even left yet and the group of Elvish Senior Historians has already hit a problem: their list of locations to check is currently empty. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- 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*, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! blog.localhost:3000/ -> hidden(localhost:3000/articles) | |
//? subdomain.vercel.app -> hidden(vercel.app/{subdomain}) | |
import { NextRequest, NextResponse } from "next/server"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//? 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"; |