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 { getHTML, getAmazonPrice } from './scrape'; | |
const productURL = `https://www.amazon.ca/Vitamix-Explorian-Professional-Grade-Low-Profile-Refurbished/dp/B07CXVSMZ4/ref=sr_1_5?keywords=vitamix&qid=1555870204&s=gateway&sr=8-5&th=1`; | |
async function scrapePage() { | |
const html = await getHTML(productURL); | |
const amazonPrice = await getAmazonPrice(html); | |
console.log(`The price is ${amazonPrice}`); | |
} |
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
{ | |
"name": "react-webpack2-bootstrap4-sass", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"clean": "rimraf dist", | |
"buildDev": "npm run build && ./node_modules/.bin/webpack-dev-server", | |
"build": "npm run clean && webpack" | |
}, |
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'); | |
// Passport | |
const passport = require('passport'); | |
const GoogleStrategy = require('passport-google-oauth20').Strategy; | |
const keys = require('./config/keys'); | |
const app = express(); |
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
function createStore(reducer, initialState) { | |
let state = initialState; | |
// Setup listners to keep track of when the state is changed | |
// to triger rerenders (observer pattern) | |
const listeners = []; | |
const subscribe = (listener) => ( | |
listeners.push(listener) | |
); |
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 MessageInput extends React.Component { | |
state = { | |
value: '', | |
} | |
onChange = (e) => { | |
this.setState({ | |
value: e.target.value, | |
}) | |
}; |
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
{ | |
"name": "SpinMyVinylServer", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"start": "node server.js", | |
"test": "export NODE_ENV=test || SET \"NODE_ENV=test\" && mocha ./**/*.test.js", | |
"test-watch": "nodemon --exec 'npm test'" | |
}, |
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 argumentList = process.argv; | |
const addThese = argumentList.slice(2,argumentList.length); | |
let sum = 0; | |
let solution = addThese.forEach((value) => { | |
// convert to a number | |
sum += Number(value); | |
return sum; | |
}); |
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
// ---- | |
// Sass (v3.4.7) | |
// Compass (v1.0.1) | |
// ---- | |
$Color1: navy; // named color value | |
$Color2: #333333; // hex color value | |
$StringVar: " with Sass"; // string variable | |
$FontSize: 18px; // numeric value | |
$border: 1px solid $Color2; // multi-value variable |
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
.container { | |
width: 960px; | |
margin: 0 auto; | |
padding: 15px 15px 15px 15px; | |
color: #333333; | |
} | |
.container h1 { | |
font-size: 54px; | |
color: navy; | |
border: 1px solid #333333; |
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
.container { | |
width: 960px; | |
margin: 0 auto; | |
border: 1px solid navy; | |
padding: 15px 15px 15px 15px; | |
color: #333333; | |
} | |
.container h1 { | |
text-align: center; | |
border: 1px solid navy; |