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
"use client"; | |
import * as React from "react"; | |
import * as TabsPrimitive from "@radix-ui/react-tabs"; | |
import { cn } from "@/lib/utils"; | |
function createPropsTunnel<TunneledProps extends Record<string, any>>( | |
defaultProps: Required<TunneledProps> | |
) { |
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 { action, makeObservable, observable, runInAction } from "mobx"; | |
export class PromiseManager<T extends (...args: any[]) => Promise<any>> { | |
status: "idle" | "pending" | "fulfilled" | "rejected" = "idle"; | |
executionCount = 0; | |
asyncFunction: T; | |
constructor(asyncFunction: T) { | |
makeObservable(this, { | |
status: observable.ref, |
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 { observable, makeObservable, runInAction, action } from "mobx"; | |
import { HistoryManager } from "./history"; | |
import { v4 as uuid } from "uuid"; | |
type Constructor<T> = { | |
new (...params: any[]): T; | |
[x: string | number | symbol]: any; | |
}; | |
type BaseData = { |
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
export interface Project { | |
id: string; | |
video: MediaReference; // hosted video | |
preview_video: MediaReference; // hosted video | |
background: MediaReference; | |
speakers: Speaker[]; | |
source_blueprint: { | |
id: string; | |
utterances: SourceUtterance[] |
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
// actions | |
decomposeVideo({ src: 'video-url'}): SourceBlueprint | |
dub({ source_transcription, target_transcription, source_audio, voice_id }): MediaReference | |
recomposeVideo(targetBlueprint: TargetBlueprint): MediaReference | |
// types | |
interface SourceBlueprint { | |
video: MediaReference // hosted video | |
background_audio: MediaReference |
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
// components/Tabs.tsx | |
import { | |
Tabs as ArkTabs, | |
TabList as ArkTabList, | |
TabTrigger as ArkTabTrigger, | |
} from '@ark-ui/react' | |
const tabs = defineMultipartRecipe({ | |
name: 'tabs', | |
parts: ['root', 'list', 'trigger'], |
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
// client | |
signIn().then((user) => { | |
axios.post('/users', user, { headers: { authorization: user.accessToken } }) | |
}) | |
// server | |
server.middleware((req, res) => { | |
if (req.headers.authorization) { | |
try { | |
const decoded = await firebase.verifyIdToken(req.headers.authorization) |
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
type Book = { | |
id: string | |
image: string | |
title: string | |
description: string | |
duration: number // (milliseconds?) | |
audio: string | |
chapters: Chapter[] | |
} |
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
{ | |
"kind": "books#volumes", | |
"totalItems": 3633, | |
"items": [ | |
{ | |
"kind": "books#volume", | |
"id": "o_dvDwAAQBAJ", | |
"etag": "b9ADYZl9aVQ", | |
"selfLink": "https://content-books.googleapis.com/books/v1/volumes/o_dvDwAAQBAJ", | |
"volumeInfo": { |
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 'react-app-polyfill/ie11'; | |
import * as ReactDOM from 'react-dom'; | |
import { | |
theme, | |
ArrowLeftIcon, | |
ArrowRightIcon, | |
ArrowDiagonalIcon, | |
CollectionsIcon, | |
Dropdown, | |
} from '../'; |
NewerOlder