This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modernizr.addTest('canvas-strokeText', function(){ | |
var ctx = document.createElement('canvas').getContext('2d'); | |
return typeof ctx.strokeText == 'function'; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assumes jQ 1.4+ | |
function preload(file) { | |
return jQuery('<link/>', { | |
href: file, | |
rel: 'stylesheet', | |
media: 'print', | |
load: function() { | |
jQuery(this).remove(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@media print { /* bummer, this doesn't seem to work at all*/ | |
zoom: expression(document.createElement('footer')); | |
footer {font-size:30px;color:blue;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (undefined) { | |
function detectMutation() { | |
mutationSupported = true; | |
this.removeEventListener('DOMAttrModified', detectMutation, false); | |
} | |
var forEach = [].forEach, | |
regex = /^data-(.+)/, | |
el = document.createElement('div'), | |
mutationSupported = false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |