Skip to content

Instantly share code, notes, and snippets.

View UserProfileSuspense.js
/**
* Sid Barrack
*
* the issues identified are commented below with the correct implementation
*/
import { Suspense, useState, useEffect } from 'react';
/*
data needs to be outside of the component, because once the promise resolves(see comment on data loading component below),
View boutiqaat-scraper.js
//loading modules
const cheerio = require('cheerio');
const puppeteer = require('puppeteer');
const {Cluster} = require('puppeteer-cluster');
const XLSX = require('xlsx');
(async () => {
//launching the browser in full mode using headless : false
const browser = await puppeteer.launch({
headless: false
});
@da7a90
da7a90 / model.js
Created Sep 25, 2019
User model for simple NodeJS authentication
View model.js
const mongoose = require('mongoose');
var userSchema = mongoose.Schema({
email : String,
password : String,
role : String
});
var User = mongoose.model('User', userSchema);
@da7a90
da7a90 / app.js
Last active Sep 25, 2019
simple authentication for beginners in NodeJS
View app.js
const express = require('express');
const bodyParser = require('body-parser');
const session = require('express-session');
const app = express();
// Configuring the database
const dbConfig = require('./database.config.js');
const mongoose = require('mongoose');
const User = require('./model')