Skip to content

Instantly share code, notes, and snippets.

View devongovett's full-sized avatar

Devon Govett devongovett

View GitHub Profile
@devongovett
devongovett / dabblet.css
Created May 4, 2012 20:42 — forked from LeaVerou/dabblet.css
Text masking — The SVG way
/**
* Text masking — The SVG way
*/
svg {
font: 900 500%/1.2 'Arial Black', sans-serif;
}
text {
fill: url(#wood);
@devongovett
devongovett / gist:2281027
Created April 2, 2012 05:33
flipped website effect for April Fools day on badassjs.com
// Original version
(function(){function s(v){document.documentElement.style[['','webkit','Moz','O','ms'].filter(function(p){return p+'Transform' in document.documentElement.style})[0]+'Transform']=v}if (!localStorage||!localStorage.flipped&&location.href!="http://badassjs.com/post/20294238453/webkit-js-yes-it-has-finally-happened-browser"){s('rotate(180deg)');document.links[0].onclick=function(){s('none');document.body.scrollTop=0;this.onclick=null;localStorage&&(localStorage.flipped=1);return !1}}})()
// Somewhat prettier version
(function() {
function s(v) {
document.documentElement.style[
['','webkit','Moz','O','ms'].filter(function(p){
return p + 'Transform' in document.documentElement.style
})[0]+'Transform'
@devongovett
devongovett / gist:2218587
Created March 27, 2012 18:11
get a blob from a canvas
function getBlob(canvas) {
var data = atob(canvas.toDataURL().replace('data:image/png;base64,', '')),
bytes = new Uint8Array(data.length);
for (var i = 0, len = data.length; i < len; i++) {
bytes[i] = data.charCodeAt(i) & 0xff;
}
var bb = new BlobBuilder();
bb.append(bytes.buffer);
function Bar() {
console.log("Bar");
}
Bar.prototype.baz = function() {
console.log("baz");
}
function Foo() {
console.log("hi");
class Set
constructor: ->
@items = {}
@count = 0
guid = 0
stringCache = {}
hash = (object) ->
switch typeof object
when 'number', 'boolean'
class FileInfo
constructor: (filename) ->
@name = filename
mtime: ->
# in CoffeeScript, the last thing in a function is returned
# which in this case is the value returned from @withFile
# which is the value returned from the inner function
# => binds scope to the correct `this`
@withFile (f) =>
/*
* Non-clamped setInterval
* By Devon Govett (idea from sink.js)
* MIT LICENSE
*/
(function() {
var BlobBuilder = this.BlobBuilder || this.MozBlobBuilder || this.WebKitBlobBuilder,
URL = this.URL || this.webkitURL,
/*
* Non-clamped setInterval
* By Devon Govett (idea from sink.js)
* MIT LICENSE
*/
(function() {
var BlobBuilder = this.BlobBuilder || this.MozBlobBuilder || this.WebKitBlobBuilder,
URL = this.URL || this.webkitURL,
/*
* Non-clamped setInterval
* By Devon Govett (idea from sink.js)
* MIT LICENSE
*/
(function() {
var BlobBuilder = this.BlobBuilder || this.MozBlobBuilder || this.WebKitBlobBuilder,
URL = this.URL || this.webkitURL,
@devongovett
devongovett / gist:1468024
Created December 12, 2011 16:05
Aurora.js Ideas

Ideas for Aurora.js

Aurora.js is a JavaScript/CoffeeScript media framework that makes implementing audio formats, both containers and codecs much easier. Here are a few things it has:

  1. Sources (HTTP, streaming, File API, etc.)
  2. Shared Code (buffers, queues, bitstreams, etc.)
  3. Containers (demuxers)
  4. Codecs (decoders)
  5. Sink.js