Skip to content

Instantly share code, notes, and snippets.

View davidwkeith's full-sized avatar

David W. Keith davidwkeith

View GitHub Profile
@davidwkeith
davidwkeith / webmaster.md
Last active September 30, 2025 23:47
Webmaster

Role and Expertise

You are a web standards expert with authoritative knowledge of specifications from W3C, WHATWG, ISO, and other relevant standards bodies. You can cite, interpret, and apply web standards with precision and explain their practical implications.

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect." — Sir Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Core Competencies

Foundational Technologies

@davidwkeith
davidwkeith / AP CS A Tutor.markdown
Created September 22, 2025 22:13
AP CS A Tutor project Instructions for ChatGPT

AP CS A Tutor Instructions

Role & Context

You are an AP Computer Science A tutor with expertise in Java and pedagogical best practices. Guide high school students who completed AP CSP (JavaScript) and now study AP CSA (Java). Make learning engaging through varied techniques.

Student Profile

  • Prerequisites: AP Computer Science Principles (JavaScript)
  • Current: AP Computer Science A (Java)
  • Level: High school, transitioning from JavaScript to Java
  • Tools: Chromebook, code.org IDE, Google Classroom
@davidwkeith
davidwkeith / gosemver.go
Created September 27, 2018 17:31
Convert go version strings to semver compliant strings
package main
import (
"fmt"
"runtime"
"strings"
"github.com/coreos/go-semver/semver"
)
Verifying that "davidwkeith.id" is my Blockstack ID. https://onename.com/davidwkeith
@davidwkeith
davidwkeith / flickering.rb
Created February 6, 2016 21:09
Flickering candle effect for Halloween
require 'hue'
CANDLE_COLOR_RANGE = [*2000..2200] # Kelvin, 2000K is lowest Hue can do
CANDLE_BRIGHTNESS_RANGE = [*20..52]
bridge = Hue.application
candle = Hue::Bulb.new(bridge, 1)
candle.on if candle.off?

Keybase proof

I hereby claim:

  • I am davidwkeith on github.
  • I am dwkeith (https://keybase.io/dwkeith) on keybase.
  • I have a public key whose fingerprint is 8AEE 1308 A48E C6BE 885B 89CD 7208 DB57 1364 E5E5

To claim this, I am signing this object:

@davidwkeith
davidwkeith / create_element.js
Created June 10, 2013 00:33
Example of document.createElement enhancement
// not sure how to detect this yet, stay tuned or leave a comment
window.document._createElement = window.document.createElement;
window.document.createElement = function(name, attributes) {
if (typeOf attributes === 'string') {
// Chrome adds an undefined 'is' attribute for the second arg, why is this?
// Chrome is also throwing a TypeError for any third arg I can think of (number, string, object)
return window.document._createElement(arguments);
} else {
var elm = window.document._createElement(name);
@davidwkeith
davidwkeith / localization_helper.js
Created July 11, 2012 21:50
Localization Helper for Ember.js's Handlebars
Handlebars.registerHelper('loc', function(property, fn) {
var str;
// we are bound to a value, it is now the context
if (fn.contexts && typeof fn.contexts[0] === 'string') {
str = fn.contexts[0];
// Convention, start all localization keys with _
} else if (property[0] === '_') {
str = property;
@davidwkeith
davidwkeith / index.html
Last active November 7, 2024 19:03
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom protocol handlers. Licensed under the WFTPL http://www.wtfpl.net/txt/copying/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>App Redirection</title>
</head>
<body>
<!--
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom
protocol handlers.