- 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 download(filename, filepath) { | |
let element = document.createElement('a'); | |
element.setAttribute('href', filepath); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); | |
document.body.removeChild(element); | |
} |
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
// takes props: | |
// apiKey: string | |
// mapOptions: object | |
// mapID: string | |
// onMapLoad: function(mapOject) | |
// mapLibraries: array[string] | |
// Function Version |
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; |
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
$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
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
{ | |
"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
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
// ---------------------------------------------------------------------- // | |
// https://developers.google.com/maps/documentation/geocoding/intro#Types // | |
// ---------------------------------------------------------------------- // | |
// returns: | |
// { | |
// address_1 | |
// address_2 | |
// city |
OlderNewer