Definitely not comprehensive. This is meant to be a basic memory aid with links to get more details. I'll add to it over time.
$ npm install mongoose --save
const mongoose = require('mongoose');
| // Initialization | |
| const webpack = require('webpack'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
| const postcssImport = require('postcss-easy-import'); | |
| const BrowserSyncPlugin = require('browser-sync-webpack-plugin'); | |
| const path = require('path'); | |
| const StyleLintPlugin = require('stylelint-webpack-plugin'); | |
| const APP = path.join(__dirname, 'app'); |
| // Offline Web Applications course on Udacity https://classroom.udacity.com/courses/ud899 | |
| //When a browser runs a service worker for the first time, an event is fired within it, 'install'. This can be used | |
| //to trigger functions to download assets and save them to the cache, using the Cache API | |
| //Started with snippet from https://gist.github.com/luke-denton/ef791e5150470814a7a155cd85b1bf80 | |
| var staticCacheName = "my-cache-v2"; //Update the cache version | |
| self.addEventListener('install', function(event) { | |
| var urlsToCache = [ |
| -- Remove the history from | |
| rm -rf .git | |
| -- recreate the repos from the current content only | |
| git init | |
| git add . | |
| git commit -m "Initial commit" | |
| -- push to the github remote repos ensuring you overwrite history | |
| git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git |
| var map; | |
| // Create a new blank array for all the listing markers. | |
| // -- @deleted // | |
| // var markers = []; | |
| function initMap() { | |
| // Constructor creates a new map - only center and zoom are required. | |
| map = new google.maps.Map(document.getElementById('map'), { | |
| center: {lat: 40.7413549, lng: -73.9980244}, |
| import React from 'react'; | |
| class Map extends React.Component { | |
| state = { | |
| mapConatienr: null, | |
| locations: null, | |
| markers: [], | |
| isRendered: false, | |
| bounds: null | |
| }; |
| var staticCacheName = 'restaurant-reviews-cache-v1'; | |
| self.addEventListener('install', event => { | |
| event.waitUntil( | |
| caches.open(staticCacheName).then(cache => { | |
| return cache.addAll([ | |
| './', | |
| './js/dbhelper.js', | |
| './js/main.js', | |
| './js/restaurant_info.js', |
| import React, {Component} from 'react'; | |
| import './App.css'; | |
| import TestComponent from "./TestComponent"; | |
| class App extends Component { | |
| read = 'hi from app'; | |
| render() { | |
| return ( | |
| <div className="App"> |
| import React, {Component, Fragment} from 'react'; | |
| import Header from "../layouts/Header"; | |
| import classes from './App.scss' | |
| import Button from "@material-ui/core/Button/Button"; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <div className={classes.App}> |
| // select database path => mongod --dbpath=<dbpath> |