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
// Update or edit | |
app.post('api/course/:id', (req,res) => { | |
// check the course if it exist | |
// if not existing, return a 404 status. | |
//validate | |
// if invalid, return 404 -bad request | |
//update course |
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 express = require('express') | |
const cors = require('cors') | |
const cookieParser = require('cookie-parser') | |
const app = express() | |
const postRoute = require('./routes/post.route.js') | |
const userRoute = require('./routes/user.route.js') | |
const corsOptions = { | |
origin: true, |
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
// FIRESTORE RULES | |
rules_version = '2'; | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
// Listings | |
match /listings/{listing} { | |
allow read; | |
allow create: if request.auth != null && request.resource.data.imgUrls.size() < 7; | |
allow delete: if resource.data.userRef == request.auth.uid; |
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
export { default as Navbar } from './Navbar/Navbar'; | |
export { default as Footer } from './Footer/Footer'; | |
export { default as InfoSection } from './InfoSection/InfoSection'; | |
export { default as Pricing } from './Pricing/Pricing'; |
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 Rating from '../components/Rating'; | |
import { getProducts } from '../api'; | |
import { parseRequestUrl } from '../utils'; | |
const HomeScreen = { | |
render: async () => { | |
const { value } = parseRequestUrl(); | |
const products = await getProducts({ searchKeyword: value }); | |
if (products.error) { | |
return `<div class="error">${products.error}</div>`; |
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
sass/ | |
| | |
|– abstracts/ (or utilities/) | |
| |– _variables.scss // Sass Variables | |
| |– _functions.scss // Sass Functions | |
| |– _mixins.scss // Sass Mixins | |
| | |
|– base/ | |
| |– _reset.scss // Reset/normalize | |
| |– _typography.scss // Typography rules |
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": "project", | |
"version": "0.1.0", | |
"description": "SASS compile|autoprefix|minimize and live-reload dev server using Browsersync for static HTML", | |
"main": "public/index.html", | |
"author": "5t3ph", | |
"scripts": { | |
"build:sass": "sass --no-source-map src/sass:public/css", | |
"copy:html": "copyfiles -u 1 ./src/*.html public", | |
"copy:js": "copyfiles -u 1 ./src/**/*.js public", |
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
let arr = [5, 10, 15, 20, 24]; | |
//================ while loop; | |
let i = 0; | |
while (i < arr.length) { | |
console.log(arr[i]); | |
i++; | |
} | |
//================ do while |
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
Hello; Hello World; World | |
Write a function that takes an integer and: | |
If the number is a multiple of 3, return "Hello". | |
If the number is a multiple of 5, return "World". | |
If the number is a multiple of both 3 and 5, return "Hello World". | |
helloWorld(3) ➞ "Hello" | |
helloWorld(5) ➞ "World" |
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
<!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>Document</title> | |
<link rel="stylesheet" href="css/style.css" /> | |
</head> | |
<body> |
NewerOlder