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 getCookie(name: string) { | |
const decodedCookies = decodeURIComponent(document.cookie); | |
const cookieList: string[] = decodedCookies.split('; '); | |
const cookie: string | undefined = cookieList.find(c => c.startsWith(name)); | |
if (cookie) { | |
return cookie.split('=')[1]; | |
} | |
return ''; | |
} |
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
// theme.ts | |
const theme = { | |
colors: { | |
black: '#000', | |
orange: '#f89f92', | |
pink: '#ff96db', | |
purple: '#181257', | |
white: '#fff | |
}, | |
// rest of the theme goes here |
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
// Typography.tsx | |
import * as React from 'react'; | |
import styled from 'styled-components'; | |
import theme from './theme'; | |
interface IText extends React.HTMLAttributes<HTMLElement> { | |
color?: keyof typeof theme.colors; | |
} |
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, useEffect } from 'react' | |
import { PROFILE_PHOTO_REQUIREMENTS } from '@src/constants' | |
import { INITIAL_MAX_SCALE } from '../constants' | |
import { roundToPrecision, checkPortraitAspectRatio } from '../utils' | |
const { | |
minLandscapeWidth, | |
minPortraitWidth, | |
minHeight |
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
{ | |
"Add id match": { | |
"prefix": "pact_id_match", | |
"body": [ | |
"pactMatchers.id(${TM_SELECTED_TEXT})" | |
] | |
}, | |
"Add oneOf match": { | |
"prefix": "pact_oneOf_match", | |
"body": [ |
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
FOR /F "tokens=* USEBACKQ" %%F IN (`tzutil /g`) DO SET PREVIOUS_TZ=%%F | |
PRINT %cd% | |
tzutil /s "UTC" | |
cmd.exe /c yarn test %* | |
tzutil /s "%PREVIOUS_TZ%" |
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
/* | |
* There are 3 key problems with the React code below. Can you find them? | |
* Assume fetchUserProfile exists elsewhere. | |
*/ | |
import { Suspense, useState, useEffect } from 'react'; | |
const SuspensefulUserProfile = ({ userId }) => { | |
const [data, setData] = useState({}); | |
useEffect(() => { | |
fetchUserProfile(userId).then((profile) => setData(profile)); |
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
gf=git fetch $* | |
gs=git status $* | |
gst=git stash $* | |
gp=git pull $* | |
gc=git commit -am $* | |
gcn=git commit -n -am $* | |
gck=git checkout $* | |
gps=git push $* | |
gcm=git checkout master $* | |
grh=git reset --hard $* |