Skip to content

Instantly share code, notes, and snippets.

💭
Helping others get started

David Humphrey humphd

💭
Helping others get started
View GitHub Profile
@humphd
humphd / hounds.js
Last active Jul 2, 2020
WEB222 Summer 2020 - Week 7 Events
View hounds.js
/**
* Image URLs of Hounds from the Dog API:
* https://dog.ceo/dog-api/documentation/breed
*/
const hounds = [
"https://images.dog.ceo/breeds/hound-afghan/n02088094_1003.jpg",
"https://images.dog.ceo/breeds/hound-afghan/n02088094_1007.jpg",
"https://images.dog.ceo/breeds/hound-afghan/n02088094_1023.jpg",
"https://images.dog.ceo/breeds/hound-afghan/n02088094_10263.jpg",
"https://images.dog.ceo/breeds/hound-afghan/n02088094_10715.jpg",
@humphd
humphd / index.html
Created Apr 5, 2020
Form Validation Files
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Form Validation</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Load Bootstrap's CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body>
@humphd
humphd / form-with-bootstrap.html
Created Mar 29, 2020
Forms, CSS, and Bootstrap Examples
View form-with-bootstrap.html
<!DOCTYPE html>
<html>
<head>
<title>Form with CSS</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
</head>
<body>
<div class="container">
@humphd
humphd / index.html
Last active Mar 14, 2020
CSS Example
View index.html
<!doctype html>
<html>
<head>
<title>CSS Layout Example</title>
<meta charset="utf-8">
<!-- Deal with viewport sizing on mobile: https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Google Fonts: 1) body text - Oswald Regular; 2) headings Cardo Regular -->
@humphd
humphd / script.js
Created Mar 4, 2020
Event Example from WEB222
View script.js
window.onload = function() {
let src = 'https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4'
document.body.addEventListener('click', function() {
// Create a source element
let source = document.createElement('source');
// Set its src to be our video URL
source.src = src;
// Grab the video element and add the source to it
let video = document.querySelector('video');
@humphd
humphd / index.html
Created Feb 13, 2020
HTML Examples from WEB222 Feb 12, 2020
View index.html
<!-- Table Example -->
<table>
<tbody>
<tr>
<td colspan="3">1</td>
</tr>
<tr>
<td>2</td>
<td>3</td>
@humphd
humphd / users.json
Created Jan 27, 2020
Fake Users Data
View users.json
[{"id":"30-037-5927","username":"cgotecliffe0","firstName":"Collin","lastName":"Gotecliffe","email":"cgotecliffe0@accuweather.com","score":4033},
{"id":"75-536-1230","username":"cpeppett1","firstName":"Clerc","lastName":"Peppett","email":"cpeppett1@discuz.net","score":4686},
{"id":"92-051-5244","username":"nbaudts2","firstName":"Nadiya","lastName":"Baudts","email":"nbaudts2@elpais.com","score":3262},
{"id":"34-016-9293","username":"bmoseby3","firstName":"Bunni","lastName":"Moseby","email":"bmoseby3@furl.net","score":438},
{"id":"24-231-6207","username":"nconkey4","firstName":"Nan","lastName":"Conkey","email":"nconkey4@independent.co.uk","score":2146},
{"id":"74-441-7599","username":"bsnelman5","firstName":"Betsy","lastName":"Snelman","email":"bsnelman5@ucoz.com","score":643},
{"id":"46-589-1373","username":"pligerton6","firstName":"Patton","lastName":"Ligerton","email":"pligerton6@epa.gov","score":2083},
{"id":"62-512-5616","username":"mbridewell7","firstName":"Madlen","lastName":"Bridewell","email":"mbridewe
@humphd
humphd / backgroundfile-51599.txt
Last active Oct 11, 2019
WEB222 - HTML Practice
View backgroundfile-51599.txt
Response To Council Request For Information On Red Light Camera Infractions
STAFF REPORT ACTION REQUIRED with Confidential Attachment
Response To Council Request For Information On Red Light Camera Infractions
Date: October 30, 2012
To: Government Management Committee
From: Director of Court Services and City Solicitor
Wards: All
View Code-From-Class-Updated.js
// NOTE: updated to fix some bugs on Mon Sept 30, 2019
/**
* Constructor function for an Email object.
*
* @param {String} rawEmail - text of a raw email, with headers and body
*/
function Email(rawEmail) {
// Step 1: split the raw email text into its two main parts: header and body.
// The split occurs at the first empty line (i.e., \n\n)
@humphd
humphd / count.ts
Created Jun 17, 2019
WEB422 Summer 2019 Week 7 Code Example: TypeScript
View count.ts
/**
* TypeScript rewrite of https://gist.github.com/humphd/c37e233f57c4b942ac3e8c30fae855f2
*
* Example module to get info about a multi-line string,
* written as an ES module.
*
* Takes a multiline string, and returns an Object:
*
* "here is a line of text"
*
You can’t perform that action at this time.