- npm init
- git ignore
- ni ts
- add tsconfig.json, tsconfig.1.json, tsconfig2.json (+ schema)
- add file.ts, file1.ts, file2.ts with params example
- run from terminal, show IDE
- add TS Config no property index
- run from terminal, show IDE
- Fix
- run from terminal, show IDE
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 { startTransition, type TransitionFunction } from "react"; | |
| function useStartTransition<Args extends unknown[]>( | |
| cb: (...args: Args) => ReturnType<TransitionFunction>, | |
| ) { | |
| return (...args: Args) => startTransition(() => cb(...args)); | |
| } |
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
| declare global { | |
| interface FormDataEnhanced<FormName extends string> { | |
| get(name: FormName): FormDataEntryValue | null; | |
| } | |
| var FormDataEnhanced: { | |
| prototype: FormDataEnhanced<string>; | |
| new<FormName extends string>(form?: HTMLFormElement, submitter?: HTMLElement | null): FormDataEnhanced<FormName>; | |
| }; | |
| } |
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
| <template> | |
| <component :is="vnode" /> | |
| </template> | |
| <script setup lang="ts"> | |
| import { | |
| h, | |
| onServerPrefetch, | |
| shallowRef, | |
| watch, |
Note
This is a generic issue template to raise awareness about exactOptionalPropertyTypes support across TypeScript libraries.
This package's types are not fully compatible with TypeScript's exactOptionalPropertyTypes compiler flag (tsconfig.json).
With exactOptionalPropertyTypes: true, optional properties behave differently — they can’t be assigned undefined unless it's explicitly part of the type. Currently, this library's types treat optional properties as implicitly allowing undefined, which causes type errors in strict setups.
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
| javascript: (() => { | |
| /* First open YT Transcript Panel, then copy paste this snippet into the console */ | |
| let linesEl = [...document.querySelector('#segments-container').children]; | |
| let linesTextIrregular = linesEl.map(el => el.textContent.trim()); | |
| let linesText = linesTextIrregular.map(l => l.split('\n').map(s => s.trim()).filter(Boolean).join(' ')); | |
| let paragraph = linesText.join('\n'); | |
| copy(paragraph); | |
| })(); |
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
| [...$0.children] | |
| .map(el => el.querySelector('.thumbnail-overlay-badge-shape.ytd-thumbnail-overlay-time-status-renderer').textContent) | |
| .map(time => time.split(':').reverse()) | |
| .map(([s = '0' , m = '0', h = '0']) => Number(s) + (Number(m) * 60) + (Number(h) * 3600)) | |
| .reduce((a, c) => a + c, 0)/3600 |
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 bash | |
| set -euo pipefail | |
| # List all starred archived GitHub repositories, then optionally unstar them. | |
| echo "Fetching starred repositories..." | |
| archived_repos=() | |
| page=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
| #!/bin/bash | |
| set -e | |
| INPUT=$(cat) | |
| NAME=$(echo "$INPUT" | jq -r .name) | |
| CWD=$(echo "$INPUT" | jq -r .cwd) | |
| DIR="$CWD/.claude/worktrees/$NAME" | |
| BRANCH="worktree-$NAME" | |
| cd "$CWD" |
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
| # cd into the root of the worktree | |
| cdw() { | |
| cd "$(git rev-parse --show-toplevel)" | |
| } | |
| # cd into the root of the default worktree | |
| cdr() { | |
| cd "$(git rev-parse --git-common-dir | xargs dirname)" | |
| } |
OlderNewer