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 { AsyncLocalStorage } from "node:async_hooks"; | |
| import { VNode, Fragment, type JSXNode, AsyncBuffer, SafeString } from "./jsx"; | |
| export { AsyncBuffer, SafeString, VNode, Fragment, type JSXNode }; | |
| // Minimal Fast/TypeSafe/SSR JSX Runtime implementation | |
| // Context API | |
| interface Context<T> { | |
| defaultValue: T; | |
| Provider: (props: { value: T; children: any }) => any; |
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 | |
| # --- Dependencies --- | |
| if ! command -v yt-dlp &> /dev/null || ! command -v fzf &> /dev/null; then | |
| echo "Error: yt-dlp and fzf are required." | |
| exit 1 | |
| fi | |
| # --- Defaults --- | |
| LIMIT=20 |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import time | |
| import json | |
| import subprocess | |
| import select | |
| import os | |
| import re |
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
| <script module lang="ts"> | |
| import { onMount, type Snippet } from "svelte"; | |
| import { register } from "@teamhanko/hanko-elements"; | |
| import type { StateName, Hanko, User } from "@teamhanko/hanko-elements"; | |
| import { PUBLIC_HANKO_API_URL } from "$env/static/public"; | |
| import { scale } from "svelte/transition"; | |
| import { goto } from "$app/navigation"; | |
| import { page } from "$app/state"; | |
| import { browser } from "$app/environment"; | |
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 modal | |
| import asyncio | |
| import io | |
| import time | |
| from typing import List | |
| from pathlib import Path | |
| PATH_ROOT = Path(__file__).parent | |
| HF_HUB_CACHE = "/hf-hub-cache" | |
| MODEL_ID = "black-forest-labs/FLUX.1-schnell" |
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 Env, type Handler } from "hono"; | |
| import type { HonoOptions } from "hono/hono-base"; | |
| import { Hono } from "hono/tiny"; | |
| import { type PropsWithChildren } from "hono/jsx"; | |
| import type { | |
| BlankEnv, | |
| BlankInput, | |
| BlankSchema, | |
| HandlerResponse, | |
| Input, |
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
| !((storageKey, buttonId, darkTheme, lightTheme) => { | |
| const getTheme = () => { | |
| if ( | |
| typeof localStorage !== "undefined" && | |
| localStorage.getItem(storageKey) | |
| ) { | |
| return localStorage.getItem(storageKey); | |
| } else if ( | |
| window.matchMedia(`(prefers-color-scheme: ${darkTheme})`).matches | |
| ) { |
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 Connect, type Plugin } from "vite" | |
| import { getRequestListener } from "@hono/node-server" | |
| import { getPlatformProxy, type PlatformProxy } from "wrangler" | |
| type HonoDevServerPlugin = { | |
| entry?: string | |
| export?: string | |
| injectClientScript?: boolean | |
| exclude?: RegExp[] | |
| ignoreWatching?: RegExp[] |
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 { Hono } from "hono"; | |
| import { compress } from "hono/compress"; | |
| import { streamSSE } from "hono/streaming"; | |
| import { createServer } from "node:http"; | |
| const app = new Hono(); | |
| app.get("/", compress({ encoding: "gzip" }), (c) => { | |
| return c.html("<h1>Hello, World!</h1>"); | |
| }); |
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 { Connect, type Plugin } from "vite" | |
| type DevSeverOptions = { | |
| /** relative path to appDir without trailing slash */ | |
| appDir?: string; | |
| } | |
| export const getHeaders = (req: Connect.IncomingMessage) => { | |
| const h = new Headers() | |
| for (const [key, value] of Object.entries(req.headers)) { |
NewerOlder