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
const Joi = require('joi'); | |
const bcrypt = require('bcrypt'); | |
const { checkRecordsExists, insertRecord } = require('../utils/sqlSchemaFunction'); | |
const SignUpSchema = Joi.object({ | |
email: Joi.string().email({ minDomainSegments: 2, tlds: { allow: ['com', 'net'] } }).required(), | |
username: Joi.string().alphanum().min(3).max(15).required(), | |
password: Joi.string().min(8).required(), | |
}); |
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
const Kiosk = () => { | |
const [voter, setVoter] = useState<Voter | null>(null); | |
useEffect(() => { | |
const channel = connect(); | |
channel.onmessage = (event) => { | |
const qrCodePrompted = QRCodePrompted.safeParse(event.data); | |
const qrCodeDismissed = QRCodeDismissed.safeParse(event.data); |
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 { PutObjectCommand, S3Client } from '@aws-sdk/client-s3'; | |
import { getSignedUrl } from '@aws-sdk/s3-request-presigner'; | |
import { createRouter } from 'next-connect'; | |
import type { NextApiRequest, NextApiResponse } from 'next'; | |
import { config as appConfig } from '../../../config'; | |
import { apiHandler, hasRequiredScopes } from '../../../util/util'; | |
const { aws } = appConfig; |
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 cdk from 'aws-cdk-lib'; | |
import { PredefinedMetric, ScalableTarget, ServiceNamespace, TargetTrackingScalingPolicy } from 'aws-cdk-lib/aws-applicationautoscaling'; | |
import { Role } from 'aws-cdk-lib/aws-iam'; | |
import { Runtime, Function, Code, Version } from 'aws-cdk-lib/aws-lambda'; | |
import { Construct } from 'constructs'; | |
import { join } from 'path'; | |
export class TestStack extends cdk.Stack { | |
constructor(scope: Construct, id: string, props?: cdk.StackProps) { | |
super(scope, id, props); |
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 classNames from 'classnames'; | |
import { useEffect, useState } from 'react'; | |
interface Props { | |
children: React.ReactNode; | |
} | |
export const RenderDate = ({ children }: Props) => { | |
const [hasMounted, setHasMounted] = useState(false); |
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 { | |
FormControl, | |
FormLabel, | |
Input, | |
FormErrorMessage, | |
FormHelperText, | |
} from '@chakra-ui/react'; | |
import classNames from 'classnames'; | |
import { useController } from 'react-hook-form'; |
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
const schema = yup.object({ | |
id: yup | |
.array() | |
.transform((value, originalValue, context) => { | |
if (context.isType(value) && value !== null) { | |
return value; | |
} | |
return originalValue ? String(originalValue).split(/[\s,]+/) : []; | |
}) |
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
require_relative '../node_modules/react-native/scripts/react_native_pods' | |
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' | |
platform :ios, '11.0' | |
target 'AwesomeProject' do | |
config = use_native_modules! | |
use_react_native!( | |
:path => config[:reactNativePath], |
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
name: Staging Deploy | |
on: | |
release: | |
types: [prereleased] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: |
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 { mocked } from 'ts-jest/utils'; | |
import fetch, { Response } from 'node-fetch'; | |
import { test } from './index'; | |
jest.mock('node-fetch'); | |
it('It works', async () => { | |
console.log = jest.fn(); |
NewerOlder