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
extends layout | |
block content | |
if (!user) | |
h1 Sign in to your account | |
p.lead You’re one step away from this awesome app. | |
a.btn.btn-primary.btn-lg.btn-block(href='/login', role='button') Login | |
br | |
a.btn.btn-default.btn-lg.btn-block(href='/register', role='button') Register | |
if (user) |
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
doctype html | |
html | |
head | |
title= title | |
meta(name='viewport', content='width=device-width, initial-scale=1.0') | |
link(href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css', rel='stylesheet', media='screen') | |
link(rel='stylesheet', href='/stylesheets/style.css') | |
body | |
block content |
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
extends layout | |
block content | |
.container | |
h1 Login | |
p.lead | |
| Sign in with your account. Don’t have one? | |
a(href='/register') Register Now. | |
form(role='form', action='/login', method='post') | |
.form-group |
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
extends layout | |
block content | |
.container | |
h1 Registration | |
p.lead Create an account. Already have one? | |
a(href='/login') Login Now. | |
form(role='form', action='/register', method='post') | |
.form-group | |
label(for='username') Username |
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 express = require('express'); | |
var path = require('path'); | |
var favicon = require('serve-favicon'); | |
var logger = require('morgan'); | |
var cookieParser = require('cookie-parser'); | |
var bodyParser = require('body-parser'); | |
var mongoose = require('mongoose'); | |
var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; |
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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var passportLocalMongoose = require('passport-local-mongoose'); | |
var Account = new Schema({ | |
username: String, | |
password: String | |
}); | |
Account.plugin(passportLocalMongoose); |
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 express = require('express'); | |
var passport = require('passport'); | |
var Account = require('../models/account'); | |
var router = express.Router(); | |
router.get('/', function(req, res, next) { | |
res.render('index', { user : req.user }); | |
}); | |
router.route('/register') |
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": "example/app", | |
"version": "1.0.0", | |
"description": "Example application for a medium blog on package.json files", | |
"scripts": { | |
"analyze": "eslint", | |
"build": "npm run scripts && npm run styles", | |
"scripts": "browserify ./example.docs.jsx -o ./example.docs.js", | |
"styles": "sass ./example.docs.scss ./example.docs.css", | |
"test": "test-jest", |
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
// Google Script on page: | |
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=googleMap.init" | |
// async defer></script> | |
var googleMap = (function(){ | |
var myLatLng = {lat: 47.550987, lng: -122.277863}, | |
map, | |
marker; | |
function initMap() { |
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
<body> | |
<div class="wrapper"> | |
<header class="header"> | |
<h1 class="header_title">Working with Google Maps asynchronously</h1> | |
<nav> | |
<ul class="header_nav"> | |
<li class="header_navItem"> | |
<a href="#">Menu</a> | |
</li> | |
<li class="header_navItem"> |
OlderNewer