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
//App.js file /////////////////////////////////////////////////////// | |
const express = require('express') | |
const app = express() | |
const port = 3000 | |
app.use("/public", express.static(__dirname + "/public")); | |
// app.use("/public", express.static(__dirname + "/public")); | |
app.get('/', (req, res) => { |
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
unction Profile({ currentUser, setUser }: IProps) { | |
const navigate = useNavigate(); | |
function handleUserImage(event: any) { | |
event.preventDefault(); | |
let image = event.target.imageUrl.files[0]; | |
let imageFormData = new FormData(); | |
imageFormData.append("imageUrl", image); | |
async function sendImage() { |
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 canvas = document.querySelector("canvas"); | |
canvas.style.border = "2px solid black"; | |
const ctx = canvas.getContext("2d"); | |
const startScreen = document.querySelector(".game-intro"); | |
//adding some cool song | |
const song = new Audio("../Eye_of_the_Tiger.mp3"); | |
song.volume = 0.1; | |
//variables |
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 expressLayouts = require('express-ejs-layouts'); | |
const path = require('path'); | |
const PunkAPIWrapper = require('punkapi-javascript-wrapper'); | |
const app = express(); | |
const punkAPI = new PunkAPIWrapper(); | |
app.set('view engine', 'ejs'); |
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
//Make sure to require your model so you can connect to the DB | |
//<========Model of viking to connect the backend to the DB | |
const { default: mongoose } = require("mongoose"); | |
const VikingModel = require("./models/User"); | |
//This line of code connects to the Database | |
require("./db"); | |
//Iteration 2: | |
//create a user as an object | |
const Ragnar = { |
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
<div id="main-ctn"> | |
<h1 class="display-artist-name"> | |
Albums for: | |
</h1> | |
<div id="main-grid"> | |
<% albumsArr.forEach(album=> { %> | |
<div class="item"> | |
<div class="item-img-ctn"> |
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
class Queue { | |
constructor() { | |
this.queueControl = []; | |
this.MAX_SIZE = 10; | |
} | |
canEnqueue() { | |
if (this.queueControl.length === this.MAX_SIZE) { | |
return false; | |
} else { |
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" /> | |
<title>Apple Pie Recipe</title> | |
<!-- Remember to link your styles --> | |
<link rel="stylesheet" href="styles/style.css" | |
</head> | |
<body> |
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" /> | |
<!-- link the Font Awesome stylesheet - CDN --> | |
<link | |
href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" |
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
// Iteration 1: Names and Input | |
let hacker1 = "Joshua" | |
console.log(`The driver's name is ${hacker1}`); | |
let hacker2 = "Josh" | |
console.log(`The navigator's name is ${hacker2}`); | |
// Iteration 2: Conditionals |
OlderNewer