This file contains 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
// Execute this code snippet in the browser console when you're | |
// already on a repo's webpage. This is pretty helpful when you | |
// want to read a large OSS project but feel overwhelmed or not | |
// sure where to start - this is a neat hack to take you to see | |
// the original core concepts of the project, which might not | |
// always work but does the job most of the time. | |
(async () => { | |
try { | |
const pathMatches = window.location.pathname.match(/\/([^\/]+\/[^\/]+)(?:\/tree\/([^\/]+))?/); |
This file contains 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
// Filter out key-value pairs in an object that start with 'naughty' | |
type RemoveNaughtyChildren<T extends {}> = { | |
[key in keyof T as key extends `naughty_${string}` ? never : key] : T[key] | |
} | |
// Test cases | |
import { Expect, Equal } from 'type-testing'; |
This file contains 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
Server Error | |
TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component | |
This error happened while generating the page. Any console logs will be displayed in the terminal window. | |
Call Stack | |
createContext | |
node_modules/reactflow/dist/umd/index.js (10:49063) | |
t | |
node_modules/reactflow/dist/umd/index.js (1:68) | |
eval |
This file contains 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 { Editor, Range } from '@tiptap/core' | |
import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state' | |
import { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view' | |
import { findSuggestionMatch as defaultFindSuggestionMatch } from './findSuggestionMatch.js' | |
export interface SuggestionOptions<I = any, TSelected = any> { | |
/** | |
* The plugin key for the suggestion plugin. | |
* @default 'suggestion' |
OlderNewer