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
// see: https://gist.github.com/grindpride/e436290d359b6da878b320b8ebf33446 | |
declare module 'tiptap-extensions' { | |
import { Extension, Node, Mark, Editor } from 'tiptap'; | |
import { Plugin } from 'prosemirror-state'; | |
export class Blockquote extends Node {} | |
export class BulletList extends Node {} | |
export class Code extends Node {} |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
// utils | |
type EnumValue<T> = T[keyof T]; | |
type EnumKey<T> = keyof T; | |
export function isEnumValue<T extends Record<string, unknown>>( | |
enm: T, | |
value: unknown | |
): value is EnumValue<T> { | |
return Object.values(enm).includes(value as any); |
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
def make_uppercase_variants(dictionary: dict[str, str]): | |
upper = {} | |
for key, value in dictionary.items(): | |
upper[key.upper()] = value.upper() | |
return upper | |
def reverse_dictionary(dictionary: dict[str, str]): | |
return {value: key for key, value in dictionary.items()} |
OlderNewer