Skip to content

Instantly share code, notes, and snippets.

View mckiersey's full-sized avatar

Sean McKiernan mckiersey

View GitHub Profile
<style>
#YouTubeForm {
display: none;
}
input[readonly] {
background-color: lightgray;
}
p,
@mckiersey
mckiersey / homepage.html
Created March 14, 2021 16:00
CSS styling for the homepage
<!-- ******************************** CSS STYLING ******************************** -->
<style>
h1,
h2,
p {
color: RGB(229, 229, 229);
font-family: helvetica;
margin: 20px;
}
<html>
<head>
<h1> This is the logged out page.</h1>
</head>
<body>
<button onclick="window.location.href='/home'">Return to Home.</button>
</body>
</html>
function signOut() {
var getUrl = `http://localhost:80/SignOut`
try {
$.get(getUrl, {})
.done(function (data) {
if (data = 'CookieDeleted') {
window.location.href = "http://localhost:80/LoggedOutPage"
} else {
alert('Something went wrong, please try to sign out again.')
}
// GET OWNER REQUEST: DESCRIPTION
// FUNCTION: Check whether viewer is also owner of profile
// 1) Send GET requst to BacKEnd route Owner with token & profile user id
// 2) If token is valid and profile user Id matches stored google id, corresponding to token then;
// 3) Show hidden element with ID = YouTubeForm
// 4) And insert 'Logged in' text into section with ID tag = 'SessionStatusText'
// 5) Else, insert 'Unlogged' text into section with ID tag = 'SessionStatusText'
try {
$.get('http://localhost:80/Owner', {
<html>
<head>
<!-- ADD BOOTSTRAP-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<!-- See here: https://getbootstrap.com/docs/4.2/getting-started/introduction/ -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
// LINK TO DATABASE CONNECTION
const pool = require('./config.js')
var path = require("path");
// google auth
const { OAuth2Client } = require('google-auth-library');
const CLIENT_ID = '170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com' // Given by Google when you set up your Google OAuth client ID: https://developers.google.com/identity/sign-in/web/sign-in
//VERIFICATION FUNCTION: The ticket inspector
<script>
// ******************************** JAVASCRIPT ******************************** //
// GET COOKIE FUNCTION
function getCookieValue(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
<!DOCTYPE html>
<html>
<head>
<title>Learning Web Dev</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id"
content="170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com">
<!--JQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>
<!DOCTYPE html>
<html>
<head>
<title>Web dev for absolute beginners</title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id"
content="170958026096-1delfs3g8tg4hoeg6bgs5ickhpe7k5pt.apps.googleusercontent.com">
<!--JQuery-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js" type="text/javascript"></script>