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 port = 5000; | |
const server = express(); | |
server.use(express.json()); | |
// write custom middleware. | |
function logger(req, res, next) { | |
console.log( |
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 chai = require('chai'); | |
const sinon = require('sinon'); | |
const sinonChai = require('sinon-chai'); | |
const cases = require('../src/app.js'); | |
const expect = chai.expect; | |
const assert = chai.assert; | |
chai.use(sinonChai); | |
describe('Cases from app.js', () => { | |
describe('apples', () => { |
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 bcrypt = require('bcrypt'); | |
const bodyParser = require('body-parser'); | |
const express = require('express'); | |
const session = require('express-session'); | |
const cors = require('cors'); | |
const User = require('./user.js'); | |
const STATUS_USER_ERROR = 422; | |
const BCRYPT_COST = 11; |
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 arrayOfStrings = ['Hello', 'Hola', 'Oi', 'Neehow', 'Guten Tag']; | |
const arrayOfInts = [1, 2, 3, 4, 5]; | |
const ln = arrayOfStrings.length; | |
console.log(ln); | |
console.log(arrayOfStrings[1]); | |
for (let i = 0; i < ln; i++) { | |
console.log(arrayOfStrings[i], i); | |
} |
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
// Mini-Bootcamp: Lesson 1 - Intro To ES6 and BEYOND! | |
// let, const are new to JavaScript as of 2015. | |
// ES6 - ES2015; | |
// math --> + - * / % | |
const name = 'Ryan'; // --> String | |
let age = 12; // --> Number | |
let isEven = false; // --> Boolean | |
let checkedIfEven = age % 2; | |
console.log(checkedIfEven); |
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 nums = ['1', '2', '3', '4', '5']; | |
const listOfPeeps = [ | |
{ | |
_id: '123512', | |
name: 'Ryan', | |
friends: ['Hermione', 'Ron', 'Harry', 'Draco'], | |
}, | |
{ | |
name: 'Donnie', _id: '32434', |
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
// var name = 'Ryan'; | |
// name = 'Ben'; | |
// var name = 'Austen'; | |
// console.log(name); | |
function logName() { | |
function foo() { | |
console.log(name); | |
} | |
return foo(); |
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
import React,{PropTypes, Component } from 'react' | |
import {StyleSheet,css} from 'aphrodite'; | |
class Pretty extends Component { | |
constructor(props){ | |
super(props); | |
this.state= { | |
show: false, | |
flag: false, | |
}; |
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
import React, { Component, PropTypes } from 'react'; | |
import { StyleSheet, css } from 'aphrodite'; | |
class Pagination extends Component { | |
constructor(props){ | |
super(props); | |
this.state = { | |
pageNodes: [], | |
} | |
this._paginationBuilder = this._paginationBuilder.bind(this); |
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
let tooltipLine = function(label, data) { | |
return data.y; | |
} | |
I'm loading the data in via componentDidMount and pushing the array to state. The data is loading fine. I just get | |
errors when trying to use the toolTip functionality. Do I need to define "Xscale on my own?". | |
return ( | |
<LineChart | |
data={this.state.data} | |
width={825} | |
height={250} |
NewerOlder