- Fork the repo
- Clone the repo
git checkout -b NEW_BRANCH
git remote add upstream ORIGINAL_REPO_URL
- Make changes
- Commit and push changes
- Open your repo on Github
- Click Compare & pull request
- Enter description
- Click Create pull request
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 parseEmojis(str) { | |
return str.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/); | |
} |
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": "eslint-prettier-demo", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"react": "^16.9.0", | |
"react-dom": "^16.9.0", | |
"react-scripts": "3.1.1" | |
}, | |
"scripts": { |
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
// https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-contrast.html | |
function getMinContrastColor(rgb, isLargeFont) { | |
const minContrastRatio = isLargeFont ? 3.0 : 4.5; | |
let contrastIsDark = isContrastDark(rgb); | |
let i = 0.01; | |
let contrastRgb = []; | |
let contrastRatio = 0; | |
while (contrastRatio < minContrastRatio && i < 1) { | |
contrastRgb = calculateGradient(rgb, contrastIsDark, i); |
Note: this feature is available with [email protected] and higher.
.env
: Default..env.local
: Local overrides. This file is loaded for all environments except test..env.development
,.env.test
,.env.production
: Environment-specific settings..env.development.local
,.env.test.local
,.env.production.local
: Local overrides of environment-specific settings.
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 getDadJoke = async () => { | |
const dadJoke = await fetch("https://icanhazdadjoke.com/", { | |
headers: { | |
Accept: "application/json" | |
} | |
}); | |
const dadJokeJSON = await dadJoke.json(); | |
if (dadJokeJSON.status === 200) { | |
return dadJokeJSON.joke; | |
} else { |
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
// ---------------------------------------------------------------------- // | |
// https://developers.google.com/maps/documentation/geocoding/intro#Types // | |
// ---------------------------------------------------------------------- // | |
// returns: | |
// { | |
// address_1 | |
// address_2 | |
// city |
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
$gap: 1rem; | |
.grid { | |
display: flex; | |
margin: 0 calc(#{$gap} / -2) -$gap calc(#{$gap} / -2); | |
flex-wrap: wrap; | |
} | |
.item { | |
flex: 0 0 auto; |
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
.container { | |
position: relative; | |
} | |
.object: { | |
position: absolute; | |
top: 50%; // moves the element 50% from the top of the container | |
left: 50%; // moves the element 50% from the left of the container | |
transform: translate(-50%, -50%); // move the element back up and to the left half of its total size | |
} |
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 isOpenNow(place) { | |
const date = new Date(); | |
const day = date.getDay(); | |
const hours = date.getHours(); | |
const minutes = date.getMinutes(); | |
const currentTime = (day * 24 + hours) * 60 + minutes; | |
// calculate the current number of minutes into the week | |
let currentlyOpen = false; |