[ Launch: just another inlet to tributary ] 4533024 by jfsiiiNo Previous Gist
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
// jquery invert plugin | |
// by paul irish | |
// some (bad) code from this css color inverter | |
// http://plugins.jquery.com/project/invert-color | |
// some better code via Opera to inverse images via canvas | |
// http://dev.opera.com/articles/view/html-5-canvas-the-basics/#insertingimages | |
// and some imagesLoaded stuff from me | |
// http://gist.github.com/268257 |
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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
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
/*! Cross-browser-compatible setZeroTimeout | |
* | |
* I took the original setZeroTimeout and made it cross-browser-compatible, using setTimeout(fn, 0) as a fallback in case postMessage is not supported. | |
* Mathias Bynens <http://mathiasbynens.be/> | |
* See <http://mathiasbynens.be/notes/settimeout-onload> | |
* | |
* Copyright statement below: | |
* | |
* See <http://dbaron.org/log/20100309-faster-timeouts> | |
* By L. David Baron <dbaron@dbaron.org>, 2010-03-07, 2010-03-09 |
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
/*! Cross-browser-compatible async | |
* | |
* I took Mathias' setZeroTimeout and changed it to async, based on http://fitzgeraldnick.com/weblog/35/. Some style changes (varible names, show logic first). | |
* | |
* I took the original setZeroTimeout and made it cross-browser-compatible, using setTimeout(fn, 0) as a fallback in case postMessage is not supported. | |
* Mathias Bynens <http://mathiasbynens.be/> | |
* See <http://mathiasbynens.be/notes/settimeout-onload> | |
* | |
* Copyright statement below: | |
* |
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
// converts milliseconds to '3:45' or if hours > 0, '2:01:23' | |
var getTimeFromMillis = function( ms ) | |
{ | |
var seconds = ':' + twoDigit( ~~( ( ms / 1000 ) % 60 ) ), | |
minutes = ~~( ( ms / ( 1000 * 60 ) ) % 60 ), | |
hours = ~~( ( ms / ( 1000 * 60 * 60 ) ) ); | |
function twoDigit( n ) { return n < 10 ? '0' + n : n; } | |
return hours > 0 ? hours + ':' + twoDigit( minutes ) + seconds : minutes + seconds; |
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
// Forked from paul irish's https://gist.github.com/601751 | |
// desire: localStorage and sessionStorage should accept objects | |
// in fact they do according to spec. | |
// http://code.google.com/p/chromium/issues/detail?id=43666 | |
// but so far that part isnt implemented anywhere. | |
// so we duckpunch set/getItem() to stringify/parse on the way in/out | |
// this seems to work in chrome |
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 (define) { | |
define(function (exports) { | |
function Color(){} | |
return Color; | |
}); | |
}( | |
// provide define if it's not available | |
this.define || (function (global, moduleId) { |
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 () { | |
/*! | |
* expose.js | |
* | |
* @author Oleg Slobodskoi | |
* @website https://github.com/kof/expose.js | |
* @licence Dual licensed under the MIT or GPL Version 2 licenses. | |
*/ | |
function expose(namespace, api) { | |
var env = {}; |
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
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.5.1.min.js'></script> | |
</head> | |
<body> | |
<h2>Naive canvas</h2> | |
<canvas id="naive" width="400" height="50"></canvas> | |
<h2>High-def Canvas</h2> |
OlderNewer