Skip to content

Instantly share code, notes, and snippets.

David W. Keith davidwkeith

Block or report user

Report or block davidwkeith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
davidwkeith / gosemver.go
Created Sep 27, 2018
Convert go version strings to semver compliant strings
View gosemver.go
package main
import (
Verifying that "" is my Blockstack ID.
davidwkeith / flickering.rb
Created Feb 6, 2016
Flickering candle effect for Halloween
View flickering.rb
require 'hue'
CANDLE_COLOR_RANGE = [*2000..2200] # Kelvin, 2000K is lowest Hue can do
bridge = Hue.application
candle =, 1)
candle.on if

Keybase proof

I hereby claim:

  • I am davidwkeith on github.
  • I am 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 / create_element.js
Created Jun 10, 2013
Example of document.createElement enhancement
View create_element.js
// 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 / localization_helper.js
Created Jul 11, 2012
Localization Helper for Ember.js's Handlebars
View localization_helper.js
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 / index.html
Last active Jul 13, 2019
Link directly to custom protocol handlers for mobile, without worrying if the user has your App installed.Licensed under the WFTPL
View index.html
<!doctype html>
<meta charset="utf-8">
<title>App Redirection</title>
NOTE: This was a great hack in days gone by, but now both Apple and Google have improved their support for custom
protocol handlers.
You can’t perform that action at this time.