Simon (aka Psymin) Lee wrote the code for this project. Feel free to use this code for your own learning, building, and projects. No acknowledgement of any kind is required. But if you found some of this code to be helpful, feel free to buy me a cappuccino or burrito if we cross paths 🌯.
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
datasource db { | |
provider = "sqlite" | |
url = env("DATABASE_URL") | |
} | |
generator client { | |
provider = "prisma-client-js" | |
binaryTargets = "native" | |
} |
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, {useState, useEffect} from 'react' | |
export default function Test() { | |
const [users, setUsers] = useState(); | |
const getApiData = async () => { | |
const response = await fetch( | |
"https://jsonplaceholder.typicode.com/users/" | |
).then((response) => response.json()); |
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
[ | |
'apple', | |
'chant', | |
'plant', | |
'giant', | |
'trial' | |
] |
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"https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"; | |
* { | |
color: inherit; | |
margin: 0 | |
} | |
body { | |
font-family: Lato, "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif; | |
background-color: #3b444b; | |
color: #f5f5f5 |
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
.hero { | |
width: 100%; | |
height: 100vh; | |
} | |
.hero-image { | |
/* "linear-gradient" to add a darken background effect to the image (photographer.jpg). This will make the text easier to read */ | |
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), | |
url('https://images.unsplash.com/photo-1596973161156-9d46c08a13bb?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1587&q=80'); | |
/* Set a specific height */ |
FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
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
// general syntax for HOC | |
const upgradedComponent = withSuperPowers(Component); | |
export default upgradedComponent; | |
// example: | |
const componentWithToggle = withToggle(Component); | |
export default componentWithToggle; | |
// more concise 1-line version: | |
export default withToggle(Component); |