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 mongoose = require("mongoose"); | |
const dbUrl = | |
"mongodb+srv://test:test123@test-db.qxz3ruo.mongodb.net/?retryWrites=true&w=majority&appName=test-db"; | |
mongoose | |
.connect(dbUrl) | |
.then(() => console.log("Successful connection to database")) | |
.catch((err) => console.error("Error: " + err)); |
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. Initializing Quiz Parameters | |
var currentQuestion = 0; | |
var score = 0; | |
var numOfQuestions = questions.length; | |
var numOfChoices = 3; | |
var questionCountElement = document.getElementById("question-count"); | |
// 2. Displaying the Current Question | |
function displayQuestion() { | |
var questionElement = document.getElementById("question"); |
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 to load content on the index.html page | |
function loadContent() { | |
const userLogin = sessionStorage.getItem("login"); | |
if (userLogin) { | |
fetchAndLoadData(); | |
} else { | |
window.location.href = "../html/signin.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
import React, { useState } from "react"; | |
import { users } from "../users"; | |
const LoginPage = () => { | |
const [username, setUsername] = useState(""); | |
const [password, setPassword] = useState(""); | |
function login() { | |
const user = users.find((u) => u.username === username); | |
if (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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
<script src="movies.js"></script> | |
</head> | |
<body id="main"> | |
<h1>Movie Database</h1> | |
<input type="text" id="search" placeholder="Search for a movie"> | |
<div id="movie-list"> |
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
// Get references to HTML elements | |
const movieList = document.getElementById('movie-list'); | |
const searchInput = document.getElementById('search'); | |
const movieDetailsContainer = document.getElementById('main'); | |
// Attach an input event listener for the search input | |
searchInput.addEventListener('input', handleSearchInput); | |
// Initialize movie data and display all movies | |
let movieData = movies; // Assuming you have a `movies` array |
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
require('dotenv').config(); | |
const express = require('express'); | |
const session = require("express-session"); | |
const path = require('path'); | |
const cookieParser = require('cookie-parser'); | |
const bodyParser = require('body-parser'); | |
const passport = require('passport'); | |
const mongoose = require('mongoose'); | |
const app = express(); | |
const Rollbar = require("rollbar"); |
This file has been truncated, but you can view the full file.
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
{ | |
"name": "react-gh-pages", | |
"version": "0.1.0", | |
"lockfileVersion": 2, | |
"requires": true, | |
"packages": { | |
"": { | |
"name": "react-gh-pages", | |
"version": "0.1.0", | |
"dependencies": { |
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 React from "react"; | |
import { | |
getFlagEmoji, | |
decodeHtmlEntities, | |
formatCountryName, | |
formatNumberWithCommas, | |
} from "./helperFunctions"; | |
const TableBody = ({ data, visibilityfilter }) => { | |
const uniqueKey = visibilityfilter === "continents" ? "continent" : "country"; |
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 React, { useState, useEffect } from "react"; | |
import "./Table.css"; | |
import { filterData, sortedData } from "./dataProcessing"; | |
import TableBody from "./TableBody"; | |
import TableHeader from "./TableHeader"; | |
import ControlPanel from "./ControlPanel"; | |
const Table = ({ covidStats }) => { | |
const [showClearButton, setShowClearButton] = useState(false); | |
const [visibilityfilter, setvisibilityfilter] = useState( |
NewerOlder