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 express = require('express'); | |
const hbs = require('hbs'); | |
const waxOn = require('wax-on'); | |
let app = express(); //create the express application | |
app.set('view engine', 'hbs'); // inform express that we are using hbs as the view engine | |
waxOn.on(hbs.handlebars); // enable wax-on for handlebars (for template inheritance) | |
waxOn.setLayoutPath('./views/layouts') // inform wax-on where to find the layouts |
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
select productCode as p, customerNumber as c from orders join orderdetails | |
on orders.orderNumber = orderdetails.orderNumber | |
group by productCode, customerNumber | |
having (productCode, customerNumber) = ( | |
select productCode, customerNumber | |
from orders join orderdetails ON orders.orderNumber = orderdetails.orderNumber | |
where productCode = p | |
group by productCode, customerNumber | |
order by sum(quantityOrdered) desc | |
limit 1 |
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
( SELECT productCode, year(orderDate) as orderYear, month(orderDate) as orderMonth | |
FROM orderdetails | |
JOIN orders on orders.orderNumber = orderdetails.orderNumber | |
GROUP BY productCode, YEAR(orderDate), MONTH(orderDate) | |
HAVING productCode = ( SELECT productCode | |
FROM orderdetails JOIN orders on orderdetails.orderNumber = orders.orderNumber | |
WHERE year(orderDate) = orderYear AND month(orderDate) = orderMonth | |
GROUP BY productCode | |
ORDER BY COUNT(*) DESC | |
LIMIT 1 |
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 renderSkillsDropdown(skills) { | |
let s = ''; | |
for (let eachSkill in skills) { | |
let skillData = skills[eachSkill]; | |
s += `<option value='${eachSkill}'>${eachSkill} (Rank: ${skillData.rank})</option>` | |
} | |
return s; | |
} | |
function renderCharacteristicsDropdown(characteristics) { |
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 express = require('express'); | |
const hbs = require('hbs'); | |
const waxOn = require('wax-on'); | |
const app = express(); | |
app.get('/', function(req,res){ | |
res.send("It's alive!") | |
}) |
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"> | |
<title>Count Me!</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<div id="box">0</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
<nav class="navbar navbar-expand-sm navbar-dark bg-dark"> | |
<div class="container-fluid"> | |
<a class="navbar-brand" href="javascript:void(0)">Logo</a> | |
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mynavbar"> | |
<span class="navbar-toggler-icon"></span> | |
</button> | |
<div class="collapse navbar-collapse" id="mynavbar"> | |
<ul class="navbar-nav me-auto"> | |
<li class="nav-item"> | |
<a class="nav-link" href="javascript:void(0)">Link</a> |
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> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Bootstrap CSS --> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> |
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
1. print(2 + 3) | |
=> print(5) | |
2. print(2 * 5 + 4) | |
=> print(10 + 4) | |
=> print(14) | |
3. print(3 + 5 * 4 / 2 ) | |
=> print(3 + 20 / 2) | |
=> print(3 + 10) |
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 in the packages | |
const express = require('express'); | |
const hbs = require('hbs'); | |
const wax = require('wax-on') | |
let app = express(); | |
app.set('view engine', 'hbs'); | |
// Inform Express where to find static images, css and | |
// client-side (ie. browser) |