Skip to content

Instantly share code, notes, and snippets.

View miketaylr's full-sized avatar
🌭

Mike Taylor miketaylr

🌭
View GitHub Profile
@miketaylr
miketaylr / README
Created February 10, 2010 00:21 — forked from sh1mmer/README
This script updates to Chromium nightly. You can run it manually, but I run it using cron.
If you run it using cron remember that it _will quit_ your running Chromium so make sure you have it set to save tabs if you want them.
In order to install it with cron run:
crontab -e
Add the line:
Modernizr.addTest('canvas-strokeText', function(){
var ctx = document.createElement('canvas').getContext('2d');
return typeof ctx.strokeText == 'function';
});
// Assumes jQ 1.4+
function preload(file) {
return jQuery('<link/>', {
href: file,
rel: 'stylesheet',
media: 'print',
load: function() {
jQuery(this).remove();
}
//lines
var ctx = $('#c')[0].getContext('2d');
ctx.lineWidth = 20;
ctx.lineCap = 'square';
ctx.lineJoin = 'round';
ctx.strokeStyle = 'rgb(247, 63, 20)';
ctx.beginPath();
ctx.moveTo(15,15);
ctx.lineTo(163,140);
var _canvas = (function(){
var cv = document.createElement('canvas'),
c = cv.getContext('2d');
cv.setAttribute('height', 1);
cv.setAttribute('width', 1);
var canvas = {}, methods = {}, attributes = {};
//stolen from Modernizr 1.2dev : http://github.com/Modernizr/Modernizr/blob/master/modernizr.js#L248
canvas['WebGL'] = (function(){
//http://miketaylr.com/code/html5-forms-ui-support.html
testSupport: function(){
var frowny = ":("; //no support frowny!
var inputs = $('input');
inputs.each(function(){
var $this = $(this);
$this.val(frowny)
.closest('td').next().text(
if (!window.localStorage || !window.sessionStorage) (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@media print { /* bummer, this doesn't seem to work at all*/
zoom: expression(document.createElement('footer'));
footer {font-size:30px;color:blue;}
}
(function (undefined) {
function detectMutation() {
mutationSupported = true;
this.removeEventListener('DOMAttrModified', detectMutation, false);
}
var forEach = [].forEach,
regex = /^data-(.+)/,
el = document.createElement('div'),
mutationSupported = false,
<input type="search" autofocus list="suggestions">
<datalist id="suggestions">
<option label="DM" value="Depeche Mode">
<option label="Moz" value="Morrissey">
<option label="NO" value="New Order">
<option label="TC" value="The Cure">
</datalist>