Skip to content

Instantly share code, notes, and snippets.

View malerba118's full-sized avatar

Austin Malerba malerba118

View GitHub Profile
{
"categories": [
{
"name": "Restaurants",
"keywords": [
"oven",
"cutlery",
"chef",
"napkin",
{
"categories": [
{
"name": "Restaurants",
"prompts": [
"The bustling ambiance of a busy restaurant, with clinking glasses, cutlery, and muffled conversations.",
"The sound of a waiter taking an order, with pen scribbling on a notepad and polite chatter.",
"The sizzle of food being cooked on a hot grill, accompanied by the sound of a spatula flipping.",
"Diners chatting and laughing, with background music playing softly.",
"The clattering of dishes being washed in the kitchen, with water running and dishes clinking.",
import {
MotionValue,
useAnimationFrame,
useMotionValue,
} from "framer-motion";
import React from "react";
export interface Clock {
value: MotionValue<number>;
setRate: (rate: number) => void;
import { range } from "lodash";
import { clamp } from "framer-motion";
export function toRadians(degrees: number) {
var pi = Math.PI;
return degrees * (pi / 180);
}
export const cos = (degrees: number) => {
return Math.cos(toRadians(degrees));
@malerba118
malerba118 / props-tunnel.tsx
Created March 1, 2024 17:22
props-tunnel-shadcn-cva
"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>
) {
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,
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 = {
export interface Project {
id: string;
video: MediaReference; // hosted video
preview_video: MediaReference; // hosted video
background: MediaReference;
speakers: Speaker[];
source_blueprint: {
id: string;
utterances: SourceUtterance[]
// 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
// 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'],