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 jwt = require('jsonwebtoken'); | |
const app = require('express')(); | |
const passport = require('passport'); | |
const LocalStrategy = require('passport-local').Stratergy; | |
const JwtStrategy = require('passport-jwt').Strategy; | |
const ExtractJwt = require('passport-jwt').ExtractJwt; | |
// Use Local Startergy for authenticating user | |
passport.use(new LocalStrategy( | |
function(username, password, done) { |
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 fs = require('fs'); | |
var axios = require('axios'); | |
var async = require('async'); | |
const Bank = require('./models/Bank'); | |
var codes; | |
var counter = 0; | |
const mongoose = require('mongoose'); | |
mongoose.Promise = global.Promise; | |
module.exports = () => { |
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, { useState } from 'react'; | |
import './scss/App.scss' | |
function App() { | |
const [todoValue, setTodoValue] = useState(''); | |
const [todos, setTodo] = useState([]) | |
const handleChange = e => { | |
setTodoValue(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
// Import font-family | |
@import url('https://fonts.googleapis.com/css?family=Roboto+Condensed:300i,400,400i,700'); | |
.todo-list { | |
max-width: 450px; | |
margin: 0 auto; | |
width: 100%; | |
font-family: 'Roboto Condensed', sans-serif; | |
button { | |
font-family: 'Roboto Condensed', sans-serif; |
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 for set Greet | |
function setGreet() { | |
let userName = localStorage.getItem('userNameKey'); | |
let now = new Date(); | |
let hours = now.getHours(); | |
//set greet msg according to hours | |
if(hours >= 4 && hours <= 12) { | |
greet_msg.innerHTML = 'Good Morning'; | |
} else if(hours >= 13 && hours <= 16) { |
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 for set User Details | |
function getDetails(e) { | |
e.preventDefault(); | |
const userName = document.getElementById('user-name_value').value; | |
JSON.stringify(localStorage.setItem('userNameKey', userName)); | |
userDetailsBlock.style.display = "none"; | |
greetBlock.style.display = 'block'; |
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
//Check Username is present in localStorage or not | |
if(localStorage.getItem('userNameKey') === null) { | |
userDetailsBlock.style.display = 'block'; | |
submitBtn.addEventListener('click', getDetails); | |
} else { | |
greetBlock.style.display = 'block'; | |
setGreet(); | |
} |
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
/* Greet Msg Block */ | |
.greet_msg { | |
text-align: center; | |
font-size: 3rem; | |
} | |
.user-details, .greet_msg { | |
display: none; | |
} |
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 hourElm = document.getElementById('hour'); | |
const minutesElm = document.getElementById('minutes'); | |
// function to set time | |
function setTime() { | |
let now = new Date(); | |
hourElm.innerHTML = now.getHours(); | |
minutesElm.innerHTML = now.getMinutes(); | |
} |
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
/* Time Block CSS */ | |
.time_block { | |
text-align: center; | |
font-size: 5rem; | |
} | |
.time_block h1 { | |
margin: 1rem 0; | |
} |
NewerOlder