This file contains hidden or 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 diffArray(arr1, arr2) { | |
let arr1UniqueItems = arr1.filter(item => arr2.indexOf(item) < 0); | |
let arr2UniqueItems = arr2.filter(item => arr1.indexOf(item) < 0); | |
return [...arr1UniqueItems, ...arr2UniqueItems]; | |
} |
This file contains hidden or 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 isIsogram(str) { | |
// Turn string into array w/ lowercase letters | |
let arr = str.toLowerCase().split(''); | |
// Create a set out of the array we just made | |
let set = new Set(arr); | |
// If the set and array have the same length, it's an isogram | |
return set.size === arr.length; | |
} |
This file contains hidden or 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, { useState } from "react"; | |
import { animated, useSpring, config } from "react-spring"; | |
import "./styles.css"; | |
export default function App() { | |
const [progress, setProgress] = useState("0%"); | |
const props = useSpring({ width: progress, config: config.slow }); | |
return ( | |
<div className="App"> | |
<div className="button-bar"> |
This file contains hidden or 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
Seven different types of CSS attribute selectors | |
// This attribute exists on the element | |
[value] | |
// This attribute has a specific value of cool | |
[value='cool'] | |
// This attribute value contains the word cool somewhere in it | |
[value*='cool'] |
This file contains hidden or 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
20 tips for developers in 2020 | |
1. Create your toolbox | |
2. Don't compare yourself to others | |
3. Pick one skill at a time to work on and learn it until you feel comfortable | |
4. Find a mentor | |
5. Decide if you want to be vertical or horizontal in knowledge | |
6. Learn how to debug | |
7. Take breaks | |
8. Do a little bit each day |
This file contains hidden or 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 from "react"; | |
import ReactDOM from "react-dom"; | |
function App() { | |
return ( | |
<div className="App"> | |
</div> | |
); | |
} |
This file contains hidden or 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 from "react"; | |
import ReactDOM from "react-dom"; | |
import Gallery from "./Gallery"; | |
import "./styles.css"; | |
function App() { | |
return ( | |
<div className="App"> | |
<Gallery /> |
This file contains hidden or 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, { useCallback, useState } from "react"; | |
import { animated, useTransition, config } from "react-spring"; | |
import mountains from "./images/mountains.jpg"; | |
import beach from "./images/beach.jpg"; | |
import desert from "./images/desert.jpg"; | |
import "./gallery.css"; | |
const images = [ |
This file contains hidden or 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
return ( | |
<div className="gallery" onClick={onClick}> | |
<p className="gallery-directions"> | |
Click anywhere to see the next image | |
</p> | |
{transitions.map(({ item, props, key }) => { | |
const Image = images[item]; | |
return <Image key={key} style={props} />; | |
})} | |
</div> |
This file contains hidden or 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
return ( | |
<div className="gallery" onClick={onClick}> | |
<p className="gallery-directions"> | |
Click anywhere to see the next image | |
</p> | |
</div> | |
); |