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
| class Saga<TContext> { | |
| private operations: Array<{ | |
| up: (context: any) => Promise<any> | |
| down: (context: any) => Promise<void> | |
| }> = [] | |
| add<TNewContext>( | |
| up: (context: TContext) => Promise<TNewContext>, | |
| down: (context: Partial<TContext & TNewContext>) => Promise<void> | |
| ): Saga<TContext & TNewContext> { |
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
| terraform { | |
| required_providers { | |
| google-beta = { | |
| source = "hashicorp/google-beta" | |
| version = "5.15.0" | |
| } | |
| } | |
| } | |
| variable "project_id" { |
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 | |
| # @author: github.com/jckw | |
| # @dependencies: | |
| # - sox (brew install sox) | |
| # Define constants | |
| TMP_FILE="/tmp/openai_recording.mp3" | |
| OPENAI_KEY="YOUR_OPENAI_API_KEY" |
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
| import { useActor, useInterpret } from "@xstate/react" | |
| import { assign, createMachine, InterpreterFrom } from "xstate" | |
| import { createContext, useContext, useEffect, ReactNode } from "react" | |
| import apiClient from "@/api/client" | |
| import { useRouter } from "next/router" | |
| import { useToast } from "@chakra-ui/react" | |
| // Warning, if you are altering this machine, you will probably need to manually refresh | |
| // the page. Because it is defined outside of React, it will not hot reload. | |
| const authMachine = createMachine( |
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
| import cartesian from "fast-cartesian" | |
| type ArrayToUnion<T extends readonly unknown[]> = T[number] | |
| type ObjectValuesToUnion<T extends Record<string, readonly unknown[]>> = { | |
| [K in keyof T]: ArrayToUnion<T[K]> | |
| } | |
| const namedCartesian = <T extends Record<string, readonly unknown[]>>( | |
| fields: T, |
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
| name: Create iOS and Android beta builds | |
| on: [workflow_dispatch] | |
| jobs: | |
| safety-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node@16 |
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
| name: Create iOS and Android beta builds | |
| on: [workflow_dispatch] | |
| jobs: | |
| safety-checks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node@16 |
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
| FROM node:16-bullseye-slim as base | |
| WORKDIR /remix | |
| ENV NODE_ENV production | |
| # 1.1 Install node_modules for build | |
| FROM base as build-deps | |
| WORKDIR /remix | |
| ADD package.json yarn.lock ./ |
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
| type Classnames = string[] | string | |
| type VariantConfig = { | |
| [variant: string]: { [option: string]: Classnames } | |
| } | |
| type Config<V extends VariantConfig> = { | |
| base: Classnames | |
| variants: V | |
| compoundVariants?: ({ |
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
| import { | |
| GetServerSideProps, | |
| GetServerSidePropsContext, | |
| GetServerSidePropsResult, | |
| NextPage, | |
| } from 'next' | |
| import { initUrqlClient, SSRData, withUrqlClient } from 'next-urql' | |
| import { | |
| cacheExchange, | |
| Client, |
NewerOlder