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 server"; | |
import { redirect } from "next/navigation"; | |
import { z } from "zod"; | |
let signUpSchema = z.object({ | |
email: z.string().min(1, "Email is required").email("Please enter a valid email address"), | |
displayName: z.string().min(2, "Display name must be at least 2 characters"), | |
password: z.string().min(6, "Password must be at least 6 characters"), | |
confirmation: z.string().min(6, "Password confirmation must be at least 6 characters"), |
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 { RecordResponse, ListResponse, PaginatedListResponse } from "@pkg/core/api"; | |
import { UserMapper, type UserEntity } from "@pkg/core/user"; | |
export type EntityIdResponse = RecordResponse<{ id: string }>; | |
/** | |
* start:users endpoints | |
*/ | |
export type UserEntityResponse = RecordResponse<UserEntity>; | |
export type UserEntityListResponse = ListResponse<UserEntity>; |
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
function ({ addBase, theme }) { | |
function extractColorVars(colorObj, colorGroup = '') { | |
return Object.keys(colorObj).reduce((vars, colorKey) => { | |
const value = colorObj[colorKey]; | |
const newVars = | |
typeof value === 'string' | |
? { [`--color${colorGroup}-${colorKey}`]: value } | |
: extractColorVars(value, `-${colorKey}`); |
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 QueryResult = { | |
nextMeeting?: Meeting; | |
scheduledMeetings: { | |
items: Meeting[]; | |
count: number; | |
hasMore: boolean; | |
}; | |
attendedMeetings: { | |
items: MeetingFields[]; | |
count: number; |
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 * as React from 'react'; | |
enum Async { | |
START, | |
SUCCESS, | |
FAILURE, | |
} | |
interface AsyncState<T> { | |
isLoading: boolean; |
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 {RefObject} from 'react'; | |
import {useEffect} from 'react'; | |
const defer = (fn: () => void) => setTimeout(fn, 0); | |
export function useCurrentItemScroller(containerRef: RefObject<HTMLElement>) { | |
useEffect(() => { | |
const containerEl = containerRef.current; | |
let observer: MutationObserver | undefined; | |
if (containerEl) { |
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
// credit @colinhacks | |
// https://github.com/remix-run/remix/pull/1254 | |
type JSONPrimitives = string | number | boolean | null; | |
type NonJSONPrimitives = undefined | Function | symbol; | |
export type SerializeType<T> = T extends JSONPrimitives | |
? T | |
: T extends undefined | |
? 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
deploy: | |
name: 🚀 Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛑 Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.1 | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v3 |
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
// Some dll injection code | |
// November 21, 2004 | |
// by SpuN [ http://spun.gamedeception.net ] | |
// injection_thread.cpp | |
DWORD WINAPI InjectionThread(LPVOID lpParam) | |
{ | |
while(1) | |
{ |
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 { | |
StorageReference, | |
UploadMetadata, | |
UploadTask, | |
} from 'firebase/storage'; | |
import * as React from 'react'; | |
import { ref, uploadBytesResumable, getDownloadURL } from 'firebase/storage'; | |
import { getStorage } from '~/services/firebase'; | |
export enum UploadState { |
NewerOlder