Skip to content

Instantly share code, notes, and snippets.

View chrisoverstreet's full-sized avatar

Chris Overstreet chrisoverstreet

  • BoomPop, Inc.
  • Lynchburg, VA
  • 07:53 (UTC -04:00)
View GitHub Profile
'use client';
import { graphql } from '__autogen__/gql';
import mime from 'mime-types';
import { useCallback } from 'react';
import {
GetSignedContractUploadUrlMutation,
GetSignedContractUploadUrlMutationVariables,
GetSignedMediaUploadUrlDocument,
useSubscription<OnUpdateEventGuestSubscription, OnUpdateEventGuestSubscriptionVariables>({
query: OnUpdateEventGuestDocument,
variables: { eventId: eventId ?? '' },
next: ({ data }) => {
const { onUpdateEventGuest: guest } = data;
if (guest) {
updateEventGuest(guest);
}
},
import { AppSyncResolverEvent } from 'aws-lambda';
import { Handler } from 'sst/context/handler.js';
import { useCookie, useCookies, useHeaders } from 'sst/node/api';
import { initUser } from '@/functions/graphql/graphql';
import { logger } from '@/lib/logger';
export const RealTimeHandler = <T, K>(cb: (e: AppSyncResolverEvent<T> & K) => Promise<unknown> | unknown) => {
// @ts-expect-error - AppSync is not a valid Handler type in our version of sst.
return Handler('appSync', cb);
[
{
"name": "Thompson Hotels",
"street_address": "S/N Calle 12",
"city": "Playa del Carmen",
"state": "Q.R.",
"country": "Mexico"
},
{
"name": "Kimpton",
["LifeClass",
"Kimpton Hotels",
"Artiem Hotels",
"Monte",
"Banyan Tree",
"Groupe Barriere",
"Sleeperz Hotels",
"Amerian Hotels",
"Alexandre Hotels and Utopia Spas",
"3C Hotels",
{
"data": {
"eventFavorites": [
{
"__typename": "EventFavorite",
"addedBy": {
"__typename": "User",
"eventRole": null,
"familyName": "Overstreet",
"givenName": "Chris",
{
"data": {
"eventVendorShortlist": {
"id": "BXY8XN",
"status": [],
"items": [
{
"additionalRequest": null,
"archivedAt": null,
"availabilities": [
import { z } from 'zod';
const DEFAULT_HEX_OPTIONS = ['#000000', '#FFFFFF'];
const hexColorSchema = z.string().regex(/^#[0-9A-F]{6}$/i);
// https://www.w3.org/TR/AERT/#color-contrast
export function bestContrastingColor(backgroundHexColor: string, ...hexOptions: string[]) {
hexColorSchema.parse(backgroundHexColor);
import { CustomNextPage } from '../_app';
import { Stack, Typography } from '@mui/material';
import { EventProvider, useEvent, useEventGuests } from '@events';
import { useEffect, useState } from 'react';
export const TestPage: CustomNextPage = () => {
const [show, setShow] = useState(false);
useEffect(() => {
const timeoutId = setTimeout(() => setShow((prev) => !prev), 1000);
@chrisoverstreet
chrisoverstreet / readme.md
Last active January 7, 2022 21:46
Payments v1

V1 - Support charging final payments + showing payment in-app

Goal of V1 is to support adding line items to an order, auto-charging final payment (including notification to organizers).

To reduce risk, we will have a flag per order to turn auto-charging on or off. This can be used to show or hide the payments tab as well.

Steps

  1. BE - Add an autocharge_balance flag to orders.