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 { assert } from 'chai' | |
import { mergeDeep as merge } from './' | |
describe('mergeDeep', () => { | |
it('should merge object properties without affecting any object', () => { | |
const obj1 = { a: 0, b: 1 } | |
const obj2 = { c: 2, d: 3 } | |
const obj3 = { a: 4, d: 5 } | |
const actual = { a: 4, b: 1, c: 2, d: 5 } |
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
<?xml version="1.0" encoding="utf-8"?> | |
<VAST version="2.0"> | |
<Ad id="229"> | |
<InLine> | |
<AdSystem version="4.9.0-10">LiveRail</AdSystem> | |
<AdTitle><![CDATA[LiveRail creative 1]]></AdTitle> | |
<Description><![CDATA[]]></Description> | |
<Impression id="LR"><![CDATA[http://t4.liverail.com/?metric=impression&cofl=0&pos=0&coid=135&pid=1331&nid=1331&oid=229&olid=2291331&cid=331&tpcid=&vid=&amid=&cc=default&pp=&vv=&tt=&sg=&tsg=&pmu=0&pau=0&psz=0&ctx=&tctx=&coty=0&adt=0&scen=&url=http%3A%2F%2Fwww.longtailvideo.com%2Fsupport%2Fopen-video-ads%2F23120%2Fwhat-is-vast%2F&cb=1259.192.118.68.5.0.690&ver=1&w=&wy=&x=121&y=121&xy=0b79&z2=0]></Impression> | |
<Creatives> | |
<Creative sequence="1" id="331"> |
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
// PS. Tailwind classes used for wrapper. | |
import { FC, useEffect, useState } from 'react' | |
import { FieldContainer } from '@keystone-ui/fields' | |
import { Field } from '@keystone-6/fields-document/views' | |
enum EditorState { | |
Loading, | |
Ready, | |
} |
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 React, { FC, useState } from 'react' | |
import { PageContainer } from '@keystone-6/core/admin-ui/components' | |
import Script from 'next/script' | |
import tailwindConfig from '../tailwind.config.js' | |
import Head from 'next/head' | |
import { ApolloProvider } from '@apollo/client' | |
import client from '../utils/graphql/apollo-client' | |
const styles = ` | |
@tailwind base; |
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 GetIndexedField<T, K> = K extends keyof T | |
? T[K] | |
: K extends `${number}` | |
? '0' extends keyof T | |
? undefined | |
: number extends keyof T | |
? T[number] | |
: undefined | |
: undefined; | |
type FieldWithPossiblyUndefined<T, Key> = |
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 { MutableRefObject, useCallback, useRef } from 'react' | |
interface UseScrollToProps { | |
parentRef: MutableRefObject<HTMLDivElement> | |
} | |
// https://gist.github.com/gre/1650294 | |
const easeInOutQuint = t => { | |
return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t | |
} |
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 { useState, HTMLAttributes, useRef, useEffect } from 'react' | |
export interface UseHoverOptions { | |
mouseEnterDelayMS?: number | |
mouseLeaveDelayMS?: number | |
} | |
export type HoverProps = Pick<HTMLAttributes<HTMLElement>, 'onMouseEnter' | 'onMouseLeave'> | |
export const useHover = ({ mouseEnterDelayMS = 0, mouseLeaveDelayMS = 0 }: UseHoverOptions = {}): [boolean, HoverProps] => { |
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 React, { PropsWithChildren, useEffect, useRef, CSSProperties } from 'react' | |
import { logger } from 'utils/logger' | |
export type CustomMouseEvent = React.MouseEvent<HTMLDivElement, MouseEvent> | |
export type CustomTouchEvent = React.TouchEvent<HTMLDivElement> | |
const MOUSE_MOVE_DELTA = 20 | |
const TOUCH_MOVE_DELTA = 30 | |
const HOLD_TRESHOLD = 500 | |
const DUPLICATE_TRESHOLD = 80 |
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
#!/bin/bash | |
# Author: Jan Soukup | |
echo "CHANGELOG" | |
echo ---------------------- | |
git tag | tr - \~ | sort -V --reverse | tr \~ - | while read TAG; do | |
echo | |
if [ $NEXT ]; then | |
echo [$NEXT] | |
else | |
echo "[Current]" |
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
# 1 - generate node_modules layer, | |
# 2 - reference layer in CDK code, | |
# 3 - profit. | |
#!/bin/sh | |
set -e | |
LAMBDA_FOLDER=nodejs | |
PRISMA_CLI_BINARY_TARGETS=rhel-openssl-1.0.x |
OlderNewer