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
wc -l $(git ls-files services/webapp/**/*.js ) | sort -n |
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
-- First create schema/data data for tests | |
DROP TABLE api.slot CASCADE; | |
CREATE TABLE api.slot ( | |
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), | |
name TEXT, | |
latitude NUMERIC, | |
longitude NUMERIC, | |
geog geography(Point, 4326) DEFAULT NULL |
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 { Dispatch, SetStateAction, useState } from 'react' | |
export default function useLocalStorage<T>( | |
key: string, | |
initialValue: T, | |
): [T, Dispatch<SetStateAction<T>>] { | |
// State to store our value | |
// Pass initial state function to useState so logic is only executed once | |
const [storedValue, setStoredValue] = useState<T>(() => { | |
if (typeof window === 'undefined') { |
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 { useCallback } from 'react' | |
import { useRouter } from 'next/router' | |
import { useTranslation } from 'react-i18next' | |
import { Box, Button, ButtonGroup } from '@material-ui/core' | |
export default function LocaleSwitcher() { | |
const { t } = useTranslation() | |
const router = useRouter() | |
const changeLang = useCallback( | |
// Same route different language |
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 type { VariantProps } from 'class-variance-authority' | |
import * as React from 'react' | |
import * as SwitchPrimitives from '@radix-ui/react-switch' | |
import { cva } from 'class-variance-authority' | |
import { cn } from '@/lib/utils' | |
const switchVariants = cva( |
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 type { ImagesResponse } from 'openai/resources/images.mjs' | |
import type { AzureOpenAIInput, OpenAIChatInput } from '@langchain/openai' | |
import { typedFetch } from '@/server/utils/fetch.utils' | |
export const generateAzureImage = async ({ | |
size, | |
prompt, | |
settings, | |
numImages, | |
}: { |
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 { LinkProps, Link as MuiLink } from '@mui/material' | |
import NextLink from 'next/link' | |
export default function Link(props: LinkProps<'a'>) { | |
return <MuiLink component={NextLink} {...props} /> | |
} |
OlderNewer