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
| // Load express module | |
| const express = require('express'); | |
| // Initialize app | |
| const app = express(); | |
| // Initialize port | |
| const port = 3000; | |
| // Initialize paths | |
| const path = require('path'); | |
| // Initialize public directory |
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'); | |
| // Schema | |
| let postSchema = mongoose.Schema({ | |
| title: { | |
| type: String, | |
| required: true | |
| }, | |
| author: { | |
| type: String, | |
| required: true |
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'); | |
| // Initialize router | |
| const router = express.Router(); | |
| // Load models | |
| let Post = require('../models/post'); | |
| router.get('/posts', function (req, res) { | |
| let posts = Post.find({}, function(err, posts){ | |
| if(err){ | |
| console.log(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
| var classes = ["A", "B", "C"]; | |
| var presentees = [40, 20, 30]; | |
| var absentees = [20,10, 10]; | |
| var attendance = []; | |
| for (var i = 0; i < classes.length; i++) { | |
| var att_obj = {}; | |
| att_obj["class"] = classes[i]; | |
| att_obj["presentees"] = presentees[i]; | |
| att_obj["absentees"] = absentees[i]; |
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
| /* <div class="loader"></div> */ | |
| .loader { | |
| position: fixed; | |
| left: 0px; | |
| top: 0px; | |
| width: 100%; | |
| height: 100%; | |
| z-index: 9999; | |
| background: url('img/loader.gif') 50% 50% no-repeat rgb(249, 249, 249); | |
| opacity: .8; |
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
| drawChart(data){ | |
| var data = [ | |
| {class: "A", absentees: 10, presentees: 30}, | |
| {class: "B", absentees: 5, presentees: 35}, | |
| {class: "C", absentees: 15, presentees: 40}, | |
| ]; | |
| var chart = document.getElementById("chart"); | |
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, shrink-to-fit=no"> | |
| <meta name="theme-color" content="#000000"> | |
| <link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | |
| <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | |
| <!-- Bootstrap core CSS --> | |
| <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" 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
| body { | |
| font-family: 'Lato', sans-serif; | |
| } | |
| .bmiPng { | |
| width: 100px; | |
| height: 100px; | |
| } | |
| .App { |
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, { Component } from 'react'; | |
| import './App.css'; | |
| import BmiCalculator from './components/BmiCalculator'; | |
| class App extends Component { | |
| constructor(){ | |
| super(); | |
| this.state = { | |
| title: "BMI Calculator" |
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, { Component } from 'react' | |
| import Form from './Form'; | |
| import Navbar from './Navbar'; | |
| import bmiPng from '../assets/bmi.png'; | |
| class BmiCalculator extends Component { | |
| constructor(props){ | |
| super(props); | |
| } |
OlderNewer