Skip to content

Instantly share code, notes, and snippets.

View prof3ssorSt3v3's full-sized avatar
🎯
Focusing

Steve Griffith prof3ssorSt3v3

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script>
class Blah extends HTMLElement {
constructor() {
super();
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Last active December 6, 2024 16:58
Promises discussion file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Promises</title>
<script>
document.addEventListener('DOMContentLoaded', init);
function init() {
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Last active December 6, 2024 16:59
Pagination Discussion File
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pagination</title>
<style>
* {
box-sizing: border-box;
font-weight: 300;
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created December 5, 2024 16:07
Event discussion file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Events</title>
<style>
body {
font-family: sans-serif;
padding: 0;
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created December 5, 2024 16:06
Content-Security-Policy Discussion File
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSP</title>
<meta http-equiv="content-security-policy" content="default-src 'self'; " />
<link rel="shortcut icon" href="" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
@prof3ssorSt3v3
prof3ssorSt3v3 / main.js
Last active January 12, 2025 04:27
Prototype discussion
const log = console.log;
function List(_values) {
//create a List object
if (!Array.isArray(_values)) return;
//exit the function if not given an array
this.items = [..._values]; //copy the array values into a property called items
this.size = this.items.length;
this.first = this.items.length > 0 ? this.items[0] : undefined;
this.last = this.items.length > 1 ? this.items[this.items.length - 1] : undefined;
@prof3ssorSt3v3
prof3ssorSt3v3 / data.js
Created October 2, 2024 16:56
Data file about the Scooby Doo main characters
const characters = [
{
name: 'Scooby-Doo',
role: 'Dog',
personality: 'Cowardly but brave when it matters',
uuid: '550e8400-e29b-41d4-a716-446655440000',
},
{
name: 'Shaggy Rogers',
role: 'Best Friend of Scooby-Doo',
@prof3ssorSt3v3
prof3ssorSt3v3 / main.js
Created July 14, 2024 18:01
Code from tutorial on Array with and copyWithin methods
//copy = Array.prototype.with(index, value)
//changed = Array.prototype.copyWithin(index, start, end)
const names = ['Bob', 'Louise', 'Gene', 'Linda', 'Teddy'];
const newNames = names.with(1, 'Gayle'); // names[1] = 'Gayle'
console.log(names);
console.log(newNames);
console.log(names == newNames); //false
console.log(names === newNames); //false
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created May 4, 2024 20:16
Code for Video about Monitoring Download Progress and displaying it with SVG animations
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SVG Progress Display for File Downloads</title>
<style>
:root {
--bgcolor: hsl(220, 20%, 70%);
--focuscolor: hsl(220, 80%, 50%);
@prof3ssorSt3v3
prof3ssorSt3v3 / data.json
Created March 26, 2024 13:11
Sample book data
{
"categories": ["historical fiction", "science fiction", "fantasy", "romance", "non-fiction", "programming", "classic"],
"books": [
{ "id": "cc196ef3-431f-4238-8aea-8a94e73229a4", "category": "science fiction", "title": "the 3 body problem", "author": "cixin lin" },
{ "id": "e2fd5989-6908-45c5-91db-d6e561fc8b8b", "category": "fantasy", "title": "the hobbit", "author": "j.r.r. tolkien" },
{ "id": "ee69e09a-61f0-4c19-bbbc-826399f678c4", "category": "programming", "title": "web developers practical guide to flutter", "author": "steve griffith" },
{ "id": "dbc27431-33b4-49fb-82a4-1ab9bea0f26a", "category": "classic", "title": "moby dick", "author": "herman melville" },
{ "id": "ef78671c-d518-468c-bfdf-4786c3a03c19", "category": "non-fiction", "title": "superintelligence", "author": "nick bostrom" }
]
}