[...new Set(Array.from(document.querySelectorAll('video,source')).map(s=>s.src))].forEach((s,i)=>s&&prompt(`Video ${i+1} URL (Copy to clipboard yourself):`,s))
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 { useEffect, act } from 'react'; | |
| import { createRoot } from 'react-dom/client'; | |
| import { afterEach, describe, expect, it, vi } from 'vitest'; | |
| interface TestClockProps { | |
| target?: number | number[]; | |
| onChange: (value: Date) => void; | |
| } | |
| type UseClockSecond = (target?: number | number[]) => Date; |
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 type { Plugin } from 'vite'; | |
| import type { NodeBuildOptions } from '@hono/vite-build/node'; | |
| import buildPlugin from '@hono/vite-build'; | |
| const nodeBuildPlugin = (pluginOptions?: NodeBuildOptions): Plugin => { | |
| const port = pluginOptions?.port ?? 3000; | |
| return { | |
| ...buildPlugin({ | |
| ...{ | |
| entryContentBeforeHooks: [ |
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 { parentPort } from 'node:worker_threads'; | |
| const heavyTask = (): string => { | |
| return "Task Completed in TypeScript! and it also works after built Javascript!"; | |
| }; | |
| parentPort?.postMessage(heavyTask()); |
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 "tailwindcss"; | |
| /* ============================================ | |
| Border Gradient Utilities for Tailwind CSS 4 | |
| ============================================ */ | |
| /* 1. Linear Gradients - 8 Directions */ | |
| @utility border-linear-to-t { | |
| --tw-border-gradient-position: to top; | |
| border-image-source: linear-gradient(var(--tw-border-gradient-position), var(--tw-border-gradient-stops)); |
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/bash | |
| #set -ex | |
| day=$(date '+%Y%m%d') | |
| now=$(date '+%Y-%m-%d %H:%M:%S') | |
| dir=$(dirname "$0") | |
| out=$(sudo docker compose --project-directory "$dir" -f "$dir/docker-compose.yml" pull) | |
| log="$dir/log/pull-$day.log" | |
| mkdir -p $(dirname "$log") |
A powerful file-based routing plugin for React Router v7 that enables automatic route generation based on your file system structure, with full support for layouts, loaders, actions, and error boundaries.
react-router7.0.0 or highervite6.0.0 or higherglobpackage (dev dependency)
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
| void (async () => { | |
| const dbName = prompt("What's the name of the database to export?"); | |
| if (!dbName) return; | |
| try { | |
| const dbExists = await new Promise(resolve => { | |
| const request = window.indexedDB.open(dbName); | |
| request.onupgradeneeded = e => { | |
| e.target.transaction.abort(); | |
| resolve(false); | |
| }; |
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 { useState, useCallback, useMemo, Dispatch, SetStateAction } from 'react'; | |
| export interface DataArray<R> { | |
| data: R[] & { added: R[]; updated: R[]; removed: R[]; initial: R[] }; | |
| length: number; | |
| isMutated: boolean; | |
| isInsert: boolean; | |
| isUpdate: boolean; |
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 { lazy, forwardRef, useEffect } from 'react'; | |
| export interface PlotlyProps extends HTMLAttributes<HTMLDivElement> { | |
| data: Partial<Data>[]; | |
| layout?: Partial<Layout>; | |
| config?: Partial<Config>; | |
| } | |
| export const Plotly = lazy( | |
| () => |
NewerOlder