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
const { Post, Author } = require('./models/post.schema') | |
const { Poem, User } = require('./models/poem.schema') | |
// Then for the post, you can run a mongoose populate like so... | |
const getPosts = async (req, res) => await Post.find({}).populate('author') | |
// Then for the poem, you want to run a mongoose populate like so... | |
const getPoems = async (req, res) => await Poem.find({}).populate({ | |
path: 'author', | |
model: 'User' |
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
{ | |
"files.autoSave": "onFocusChange", | |
"editor.tabSize": 2, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.wordWrap": "on", | |
"editor.fontFamily": "Fira Code iScript", | |
"editor.fontLigatures": true, | |
"terminal.integrated.fontFamily": "'Fira Code iScript'", | |
"emmet.includeLanguages": { | |
"ejs": "html", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-eqX-UA-Compatible content="ie=edge" /> | |
<title>Mini App</title> | |
<style> | |
body { | |
margin: 0; |
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
{ | |
"files.autoSave": "onFocusChange", | |
"editor.tabSize": 2, | |
"editor.multiCursorModifier": "ctrlCmd", | |
"editor.wordWrap": "on", | |
"editor.fontFamily": "Fira Code iScript", | |
"editor.fontLigatures": true, | |
"terminal.integrated.fontFamily": "'Fira Code iScript'", | |
"emmet.includeLanguages": { | |
"ejs": "html", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>CSS Flexbox : It's all in the box (part 1)</title> | |
<link rel="stylesheet" href="style.css" /> | |
</head> | |
<body> |
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 url('https://fonts.googleapis.com/css?family=Nunito'); | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
body { | |
background: #eee; | |
font-family: 'Nunito', sans-serif; |
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
const nav = document.querySelector('nav') | |
let navTop = nav.offsetTop | |
const stickyNav = () => { | |
if (window.scrollY >= navTop) { | |
document.body.classList.add('fixed_nav') | |
} else { | |
document.body.classList.remove('fixed_nav') | |
} | |
} |