Skip to content

Instantly share code, notes, and snippets.

@boyofgreen
boyofgreen / new input.css
Created April 4, 2012 03:01
HTML5 Hacks 2.7
input[type=number]{border: 2px solid green}
input:invalid {border: 2px solid red}
@boyofgreen
boyofgreen / date input.html
Created April 4, 2012 02:47
HTML5 Hacks 2.6
<form name=”dateSelection”>
Enter Departing Date: <input type="date" min="2012-03-12" name="departingDate" />
<input type="submit" />
</form>
<form name="myForm">
Quantity (between 1 and 5): <input type="number" name="quantity" min="1" max="5" oninput= “updateMessage(this)”/>
Enter Your Email: <input type="email" name="myEmail" formnovalidate />
<input type="submit" />
</form>
@boyofgreen
boyofgreen / auto complete.html
Created April 4, 2012 01:59
HTML5 Hacks 2.4
<!DOCTYPE html>
<html>
<body>
<form id="myForm">
Add your telephone: <input type="tel" name="phone" autocomplete=”on” /><br />
</form>
@boyofgreen
boyofgreen / HTML5 nav.css
Created April 4, 2012 01:49
HTML5 Hacks 2.3
.nav {
color: red
}
.nav {
display: block;
background-color: blue
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>...</title>
</head>
<body>
<header data-yuigrid=”doc2” data-wordpress=”2833893”>...</header>
<nav>...</nav>
<article data-yuigrid=”doc2” data-wordpress=”887478”>...</article>
@boyofgreen
boyofgreen / HTML5-2.1.html
Created April 4, 2012 01:36
HTML5 Hacks 2.1
<!-- HTML5 doctype -->
<!doctype html>
<!--XHTML doctype -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@boyofgreen
boyofgreen / hacks2.10.1.html
Created April 3, 2012 03:46
HTML5 Hacks 2.10
<li itemscope>
<ul>
<li>Name: <span itemprop=”name”>Fred</span></li>
<li>Phone: <span itemprop=”telephone”>210-555-5555</span></li>
<li>Email: <span itemprop=”email”>[email protected]</span></li>
</ul>
</li>
@boyofgreen
boyofgreen / gist:2209397
Created March 26, 2012 20:24
face reco js
drawToCanvas : function(effect) {
var video = App.video,
ctx = App.ctx,
canvas = App.canvas,
i;
ctx.drawImage(video, 0, 0, 520,426);
//get the image data pixels from the canvas and pass it to js
App.pixels = ctx.getImageData(0,0,canvas.width,canvas.height);
@boyofgreen
boyofgreen / gist:2209391
Created March 26, 2012 20:23
face reco css
App.init = function() {
// Prep the document
App.video = document.querySelector('video');
App.glasses = new Image();
App.glasses.src = "i/glasses.png";
App.canvas = document.querySelector("#output");
App.ctx = this.canvas.getContext("2d");