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 / 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" }
]
}
@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>
@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 / index.html
Last active April 28, 2024 03:01
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>
@prof3ssorSt3v3
prof3ssorSt3v3 / promises.js
Created January 16, 2024 21:46
300 afternon
const url1 = 'https://picsum.photos/id/123/300/200'; //200 status
const url3 = 'https://picsum.photos/id/237/300/200'; //200 status
// const url3 = 'https://picsum.photos/id/466/300/200'; //200 status
const url2 = 'https://jsonplaceholder.typicode.com/posts'; //200 status
const url6 = 'http://127.0.0.1:5500/300/index.html';
const url4 = 'https://picsum.photos/id/999999/300/200'; // 404 status
const url5 = 'https://example.com/bad-url'; //bad domain
import { AfternoonError } from './error.js';
document.addEventListener('DOMContentLoaded', () => {
//promises.js
document.addEventListener('DOMContentLoaded', function () {
getData();
});
function getData() {
let url1 = 'https://picsum.photos/id/237/300/200';
let url2 = 'https://picsum.photos/id/466/300/200';
let url3 = 'https://picsum.photos/id/123/300/200';
@prof3ssorSt3v3
prof3ssorSt3v3 / index.html
Created January 15, 2024 22:22
Starter code for Service Worker Assignment January 2024
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Syncing Data Page</title>
<script src="./js/main.js" type="module"></script>
<link rel="stylesheet" href="./css/main.css" />
</head>
<body>
@prof3ssorSt3v3
prof3ssorSt3v3 / burger.js
Last active January 4, 2024 17:25
Starter files for Class Exercise
class Burger {
#isMeatless = false;
#isCooked = false;
toppings = [];
constructor(_isMeatless = false, ...toppings) {
this.#isMeatless = _isMeatless;
this.toppings = toppings;
}
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Created December 7, 2023 14:45
ColorScheme reference for Flutter
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@prof3ssorSt3v3
prof3ssorSt3v3 / main.dart
Created October 13, 2023 19:37
crimson-glimmer-0444
void main() {
for (int i = 0; i < 5; i++) {
print('hello ${i + 1}');
}
}