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
| #!/bin/zsh | |
| # Expo Server Manager - Prompts to kill existing port 8081 process before starting Expo dev server | |
| # | |
| # Setup: | |
| # 1. Save this file to ~/.expo-server-manager.sh | |
| # 2. Add to ~/.zshrc: source ~/.expo-server-manager.sh | |
| # 3. Add aliases: | |
| # alias es='start_expo false' | |
| # alias esc='start_expo true' |
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 { useRouter } from "next/navigation"; | |
| import type { ReactNode } from "react"; | |
| import { useCallback, useEffect, useState } from "react"; | |
| interface ProximityPrefetchProps { | |
| children: ReactNode; | |
| threshold?: number; | |
| predictionInterval?: number; |
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 { AnimatePresence, motion } from "motion/react"; | |
| import { useRef, useState } from "react"; | |
| type TabValue = "free" | "monthly" | "yearly"; | |
| export default function App() { | |
| const [value, setValue] = useState<TabValue>("free"); | |
| const code = ` | |
| // Wrap the Tab component in a div to control its dimensions | |
| <div className="w-[500px] h-14"> |
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
| // Types for the result object with discriminated union | |
| type Success<T> = { | |
| data: T; | |
| error: null; | |
| }; | |
| type Failure<E> = { | |
| data: null; | |
| error: E; | |
| }; |