Skip to content

Instantly share code, notes, and snippets.

View JosephLivengood's full-sized avatar

Joseph Livengood JosephLivengood

View GitHub Profile
function addMinutesLabel(minutes) {
return minutes+'min';
}
// WED JAN 17
function formatDate(ts) {
const date = new Date(ts);
const options = {
weekday: 'short',
month: 'short',
@JosephLivengood
JosephLivengood / server.js
Created February 14, 2017 01:55
FCC BCrypt Complete
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const app = express();
var bcrypt = require('bcrypt');
fccTesting(app); //For FCC testing purposes
const saltRounds = 13;
@JosephLivengood
JosephLivengood / client.js
Created February 12, 2017 19:01
FCC Advanced Node and Express Socket.IO Checkpoint 2 (Client)
$( document ).ready(function() {
/*global io*/
var socket = io();
$('form').submit(function(){
var messageToSend = $('#m').val();
socket.emit('chat message', messageToSend);
$('#m').val('');
return false; // prevent form submit from refreshing page
@JosephLivengood
JosephLivengood / server.js
Created February 12, 2017 19:00
FCC Advanced Node and Express Socket.IO Checkpoint 2 (Server)
'use strict';
const express = require('express');
const session = require('express-session');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const auth = require('./app/auth.js');
const routes = require('./app/routes.js');
const mongo = require('mongodb').MongoClient;
const cookieParser= require('cookie-parser')
@JosephLivengood
JosephLivengood / server.js
Created February 12, 2017 17:50
FCC Advanced Node and Express Socket.IO Checkpoint 1
'use strict';
const express = require('express');
const session = require('express-session');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const auth = require('./app/auth.js');
const routes = require('./app/routes.js');
const mongo = require('mongodb').MongoClient;
const cookieParser= require('cookie-parser')
@JosephLivengood
JosephLivengood / server.js
Last active September 6, 2020 12:33
FCC Advanced Node and Express Social Auth Checkpoint 1
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const mongo = require('mongodb').MongoClient;
const passport = require('passport');
const app = express();
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const passport = require('passport');
const mongo = require('mongodb').MongoClient;
const ObjectID = require('mongodb').ObjectID;
const LocalStrategy = require('passport-local');
@JosephLivengood
JosephLivengood / server.js
Last active August 27, 2020 08:29
FCC Advanced Node and Express Checkpoint 3
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const passport = require('passport');
const mongo = require('mongodb').MongoClient;
const ObjectID = require('mongodb').ObjectID;
const LocalStrategy = require('passport-local');
@JosephLivengood
JosephLivengood / server.js
Last active May 26, 2020 13:25
FCC Advanced Node and Express Checkpoint 2
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const passport = require('passport');
const ObjectID = require('mongodb').ObjectID;
const mongo = require('mongodb').MongoClient;
@JosephLivengood
JosephLivengood / server.js
Last active July 8, 2020 10:24
FCC Advanced Node and Express Checkpoint 1
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const session = require('express-session');
const passport = require('passport');
const app = express();