Skip to content

Instantly share code, notes, and snippets.

@jcharles22
jcharles22 / gist:cf94f4751a92f6ae55da71c015cabb94
Created July 2, 2019 02:26
fullstack capstone user stories
New User | Play the game without signing in | High
New User | set number of players | High
New User | give players nickname | High
New User | register account | High
Returning User | Login | High
Returning User | Add Cards to the Database | Medium
Returning User | Remove cards that only this user added | Low
Returning User | toggle cards to be play with | Low
Returning User | Login/logout | High
Returning User | Notification of all the new cards added to the database since last login |
A drinking game where the user's asked how many player and names then gets a random card from the database with
what the players have to do and just flip through the cards till a set of cards have been flipped through and
ask if they want to play again.
a user can login to add cards to the database and see all cards that are in there
also they can pick and choose which cards they want to play with.
Should the client or the server take more security precautions?
Server
What's the difference between local storage and session storage?
session storage gets cleared when the page session ends.
What problem does a JWT expiry time solve?
that JWTs are valid forever
Is a refresh endpoint protected or public?
@jcharles22
jcharles22 / gist:ece4bbfcb47e7cd92d8df3bed720ab04
Created June 20, 2019 03:28
Relationships and schema design assignment
--asignment 1
select
e.emp_name,
d.dept_name
from
employee e
join
department d
on
e.department = d.id
@jcharles22
jcharles22 / shopping-list-service
Created June 13, 2019 21:28
Building services asignment
const ShoppingListService = {
getAllItems(knex) {
return knex
.select('*')
.from('shopping_list')
},
getById(knex, id) {
return knex
.from('shopping_list')
.select('*')
require('dotenv').config();
const knex = require('knex');
const knexInstance = knex({
client: 'pg',
connection: process.env.DB_URL
})
function searchName(searchTerm) {
drop table if exists bookmarks;
CREATE table bookmarks (
id primary key ,
title text not null,
rating INTEGER not null,
description text not null,
url text not null,
imgUrl text,
@jcharles22
jcharles22 / gist:5658201a3abdd9a34029901de2938881
Last active June 7, 2019 04:10
Add meta data in head to get picture to display on Linkedin
<meta prefix="og: http://ogp.me/ns#" property="og:title" content="{Your content}" />
<meta prefix="og: http://ogp.me/ns#" property="og:type" content="{Your content}" />
<meta prefix="og: http://ogp.me/ns#" property="og:description" content="{Your content}" />
<meta prefix="og: http://ogp.me/ns#" property="og:image" content="{Your content}" />
<meta prefix="og: http://ogp.me/ns#" property="og:url" content="{Your content}" />
@jcharles22
jcharles22 / gist:fbe251280bb489ea13e86d69e6abb2a3
Created June 1, 2019 21:31
Integration Testing Assignment
const express = require('express');
const playstore = require('./playstore');
const app = express();
app.get('/apps', (req, res, next) => {
let { sort, genres='' } = req.query
if(sort) {
if(!['rating', 'app'].includes(sort.toLowerCase())) {
res.status(400).send('Sort has to be rating or app.')
@jcharles22
jcharles22 / gist:f2ec514a196e5d628781b2710756b411
Created May 31, 2019 01:14
Working with the Express response object Assignment
const express = require('express');
//data to import
const playstore = require('./playstore');
const app = express();
app.get('/apps', (req, res, next) => {
let { sort, genres='' } = req.query
if(sort) {
if(!['rating', 'app'].includes(sort.toLowerCase())) {