Skip to content

Instantly share code, notes, and snippets.

View beaucarnes's full-sized avatar
💭
Follow me on Twitter: @beaucarnes

Beau Carnes beaucarnes

💭
Follow me on Twitter: @beaucarnes
View GitHub Profile
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const userSchema = new Schema({
username: {
type: String,
required: true,
unique: true,
trim: true,
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const exerciseSchema = new Schema({
username: { type: String, required: true },
description: { type: String, required: true },
duration: { type: Number, required: true },
date: { type: Date, required: true },
}, {
const router = require('express').Router();
let User = require('../models/user.model');
router.route('/').get((req, res) => {
User.find()
.then(users => res.json(users))
.catch(err => res.status(400).json('Error: ' + err));
});
router.route('/add').post((req, res) => {
const router = require('express').Router();
let Exercise = require('../models/exercise.model');
router.route('/').get((req, res) => {
Exercise.find()
.then(exercises => res.json(exercises))
.catch(err => res.status(400).json('Error: ' + err));
});
router.route('/add').post((req, res) => {
import React, { Component } from 'react';
import DatePicker from 'react-datepicker';
import "react-datepicker/dist/react-datepicker.css";
import axios from 'axios';
export default class EditExercise extends Component {
constructor(props) {
super(props);
this.onChangeUsername = this.onChangeUsername.bind(this);
var http = require('http');
var fs = require('fs');
var path = require('path');
http.createServer(function (request, response) {
console.log('request ', request.url);
var filePath = './public' + request.url;
if (filePath == './public/') {
filePath = './public/index.html';
[
{"url":"https://www.freecodecamp.org/news/a-beginners-guide-to-git-how-to-create-your-first-github-project-c3ff53f56861","tags":["Git","Programming","Technology","Productivity","Software Development"]},
{"url":"https://www.freecodecamp.org/news/7-important-lessons-about-programming-that-ive-learned-at-17-516ae619686","tags":["Programming","Technology","Learning To Code","Coding","Lessons Learned"]},
{"url":"https://www.freecodecamp.org/news/a-beginners-guide-to-git-how-to-create-your-first-github-project-c3ff53f56861","tags":["Git","Programming","Technology","Productivity","Software Development"]},
{"url":"https://www.freecodecamp.org/news/7-important-lessons-about-programming-that-ive-learned-at-17-516ae619686","tags":["Programming","Technology","Learning To Code","Coding","Lessons Learned"]},
{"url":"https://www.freecodecamp.org/news/zipline-build-a-smart-javascript-calculator-65e21a8b0b0c","tags":["JavaScript","Mathematics","Education","Programming","Design"]},
{"url":"https://www.freecodecamp.org/news/z
const express = require('express');
const app = express();
const port = 3000;
let list = [];
app.get('/', (req, res) => {
res.json(list);
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>freeCodeCamp.org</title>
8. [Python] Object Oriented Programming in Python
• Learn Python Basics by Building a Blackjack Game
• Learn Intermediate Python by Building a Contact Book Program
• Learn Object Oriented Programming by Building a Minesweeper Game
• Learn Recursion by Solving the Tower of Hanoi Puzzle
• Required Project: Pig Latin Translator
• Required Project: Time Calculator
• Required Project: Stack Calculator
• Required Project: Budgeting App (using Object Oriented Programming)
• Required Project: Area Calculator for Rectangles and Squares (using Object Oriented Programming)