Skip to content

Instantly share code, notes, and snippets.

View kentbrew's full-sized avatar

Kent Brewster kentbrew

View GitHub Profile
@kentbrew
kentbrew / wholikesmitt.html
Created November 11, 2012 02:00
Who Likes Mitt?
<html>
<head>
<title>Who Likes Mitt?</title>
<style>
pre#output {
height: 12em;
width: 500px;
overflow: auto;
}
</style>
### this is a test
_yes_
<script>
alert('ding');
</script>
__it is!__
@kentbrew
kentbrew / gist:4118769
Created November 20, 2012 15:56
Caltrain Has Broken, a Traditional Hymn
[to put you in the mood for this, imagine Cat Stevens on a train platform,
singing for spare change]
Caltrain is broken, like every morning
Announcer has spoken, all trains are slow
Praise the conductor, praise the announcer
Praise the guy in the hard hat and reflective vest who sends you to the northbound platform.
Sweet is the bus bridge to Palo Alto,
No bathroom there, go piss on the grass,
@kentbrew
kentbrew / gist:4146052
Created November 26, 2012 00:54
stub.txt
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title></title>
<link href="presentation.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<script src="behavior.js" type="text/javascript"></script>
<p>Boy, it would sure be nice if I could include URLs with Hammer as well as local files.</p>
@kentbrew
kentbrew / collide-o-scope.js
Last active December 10, 2015 10:38
New-and-improved Collide-O-Scope, now with requestAnimationFrame goodness!
// new and improved collide-o-scope
(function (w, d, n, a) {
var $ = w[a.k] = {
'w': w, 'd': d, 'n': n, 'a': a, 's': {},
'f': (function () {
return {
listen : function (el, ev, fn) {
if (typeof $.w.addEventListener !== 'undefined') {
el.addEventListener(ev, fn, false);
@kentbrew
kentbrew / requestAnimationFrame.js
Created December 31, 2012 18:49
Sparse example implementation of requestAnimationFrame
var drawStuff = function () {
// draw stuff here
};
// draw and ask requestAnimationFrame to call you again when ready
var animate = function () {
drawStuff();
w.requestAnimationFrame(animate);
};
@kentbrew
kentbrew / noaiee.html
Created January 1, 2013 01:41
META and "conditional comment" that will detect Chrome Frame and redirect users of IE8 and below to noaiee.com
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!--[if lt IE 9]>
<style>html{display:none!important;}</style>
<META http-equiv="refresh" content="0;URL=http://noaiee.com/">
<![endif]-->
// drag to create data:URI
(function (w, d, a) {
var $ = w[a.k] = {};
$.a = a;
$.w = w;
$.d = d;
$.s = {};
$.f = (function () {
return {
// super old, super crude, and no longer working
if (navigator.userAgent.match("MSIE")) {
window.onerror = function() {
gotcha();
}
}
if (navigator.userAgent.match("Gecko")) {
window.onerror = gotcha;