Skip to content

Instantly share code, notes, and snippets.

View prof3ssorSt3v3's full-sized avatar
🎯
Focusing

Steve Griffith prof3ssorSt3v3

🎯
Focusing
View GitHub Profile
@prof3ssorSt3v3
prof3ssorSt3v3 / snippets.json
Created May 3, 2021 19:44
Emmet customizations. Sample snippets.json file.
{
"html": {
"snippets": {
"!!": "{<!DOCTYPE html>}>html[lang='${lang}']>(head>meta[charset='${charset}']+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta[name='viewport'][content='width=device-width,initial-scale=1.0']+link:css+title>{${title}${1}})+(body>(header>h1>{${title}})+(main>h2>{Page Title})+(footer>p>{&copy;})+script:src)",
"nav:3": "nav>a.navlink[href='#']*3>{Link $}",
"nav:4": "nav>a.navlink[href='#']*4>{Link $}"
}
}
}
@prof3ssorSt3v3
prof3ssorSt3v3 / Form.jsx
Created March 19, 2024 13:55
Sample Form starter for React
import { useState } from 'react';
export default function Form() {
const [firstName, setFirstName] = useState('');
const [age, setAge] = useState('');
const ageAsNumber = Number(age);
// ...
return (
<form>
const app = {
pages: [],
show: new Event('show'),
init: function(){
app.pages = document.querySelectorAll('.page');
app.pages.forEach((pg)=>{
pg.addEventListener('show', app.pageShown);
})
document.querySelectorAll('.nav-link').forEach((link)=>{
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created September 9, 2021 19:06
Code from the Star Wars API video
const APP = {
//call the APP.urls.base to see the contents of APP.urls
urls: {
base: 'https://swapi.dev/api/',
people: 'people/',
planets: 'planets/',
films: 'films/',
species: 'species/',
vehicles: 'vehicles/',
starships: 'starships/',
@prof3ssorSt3v3
prof3ssorSt3v3 / show-characters.json
Created March 12, 2024 13:35
Sample data of characters from Archer, Bob's Burgers, and Futurama
[
{
"uuid": "a1b2c3d4-e5f6-g7h8-i9j0k1l2m3n4",
"name": "Sterling Archer",
"show": "Archer",
"voice_actor": "H. Jon Benjamin"
},
{
"uuid": "b2c3d4e5-f6g7-h8i9-j0k1l2m3n4o5",
"name": "Leela",
@prof3ssorSt3v3
prof3ssorSt3v3 / app.js
Created January 29, 2020 01:23
From Video tutorial about Express JS and the many types of variables and settings
"use strict";
const express = require("express");
const app = express();
const apples = require("./routes/apples");
const port = process.env.port || 4040;
app.set("views", "./views");
app.set("view engine", "pug");
app.set("custom", "Mandalorian");
app.locals.ihave = "spoken"; //lifetime of application
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created January 19, 2024 22:46
Starter code for Cache Storage assignment - /index.html, /css/main.css, /js/main.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cache Storage</title>
<link rel="stylesheet" href="./css/main.css" />
<script type="module" src="./js/main.js"></script>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Putting User Input into JS Objects</title>
<style>
.formBox{
padding: 0.5rem 2rem;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>MultiLingual</title>
<style>
button {
@prof3ssorSt3v3
prof3ssorSt3v3 / 404.html
Last active February 26, 2024 02:09
Code from Service Worker Review
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>404</title>
<link rel="stylesheet" href="main.css" />
<style>
html {