https://www.npmjs.com/package/next-themes
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
#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; |
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 { 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" | |
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 { Effect ,Data} from "effect"; | |
import { Schema } from "@effect/schema"; | |
interface Todo{ | |
id: number; | |
title: string; | |
} | |
const TodosSchema = Schema.Array( | |
Schema.Struct({ |
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 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); |
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 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. |
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 Raw = `....h.....Q..............Y........................ | |
...............................Y........C......... | |
...............m..........x................B...... | |
........................Y..............qB......... | |
......g4.........................h..Y.....q...c... | |
................n.....R........................... | |
.......................................w........5. |
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 7: Bridge Repair --- | |
// The Historians take you to a familiar rope bridge over a river in the middle of a jungle. The Chief isn't on this side of the bridge, though; maybe he's on the other side? | |
// When you go to cross the bridge, you notice a group of engineers trying to repair it. (Apparently, it breaks pretty frequently.) You won't be able to cross until it's fixed. | |
// You ask how long it'll take; the engineers tell you that it only needs final calibrations, but some young elephants were playing nearby and stole all the operators from their calibration equations! They could finish the calibrations if only someone could determine which test values could possibly be produced by placing any combination of operators into their calibration equations (your puzzle input). | |
// For example: |
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 6: Guard Gallivant --- | |
// The Historians use their fancy device again, this time to whisk you all away to the North Pole prototype suit manufacturing lab... in the year 1518! It turns out that having direct access to history is very convenient for a group of historians. | |
// You still have to be careful of time paradoxes, and so it will be important to avoid anyone from 1518 while The Historians search for the Chief. Unfortunately, a single guard is patrolling this part of the lab. | |
// Maybe you can work out where the guard will go ahead of time so that The Historians can search safely? | |
// You start by making a map (your puzzle input) of the situation. For example: | |
// ....#..... |
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 5: Print Queue --- | |
// Satisfied with their search on Ceres, the squadron of scholars suggests subsequently scanning the stationery stacks of sub-basement 17. | |
// The North Pole printing department is busier than ever this close to Christmas, and while The Historians continue their search of this historically significant facility, an Elf operating a very familiar printer beckons you over. | |
// The Elf must recognize you, because they waste no time explaining that the new sleigh launch safety manual updates won't print correctly. Failure to update the safety manuals would be dire indeed, so you offer your services. | |
// Safety protocols clearly indicate that new pages for the safety manuals must be printed in a very specific order. The notation X|Y means that if both page number X and page number Y are to be produced as part of an update, page number X must be printed at some point before page number Y. | |
// The Elf has for you both the page ordering rules and the pages to produce in each update (your p |
NewerOlder