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 reapplyTimeoutId = null | |
$each(['insertBefore', 'replaceChild', 'removeChild', 'appendChild'], function(methodName) { | |
Node.prototype["_" + methodName] = Node.prototype[methodName] | |
Node.prototype[methodName] = function() { | |
var ret = this["_" + methodName](arguments[0], arguments[1]) | |
if (reapplyTimeoutId) { clearTimeout(reapplyTimeoutId) } | |
reapplyTimeoutId = setTimeout(Attitude.applyDefinitions.bind(Attitude), 100) | |
return ret | |
} |
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
Fx.Scroll.implement({ | |
scrollToCenter: function(el, axes, offset){ | |
axes = axes ? $splat(axes) : ['x', 'y']; | |
el = $(el); | |
var to = {}, | |
pos = el.getPosition(this.element), | |
size = el.getSize(), | |
scroll = this.element.getScroll(), | |
containerSize = this.element.getSize(), | |
edge = { |
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
// -*- Mode: Javascript; tab-width: 4; -*- | |
/* | |
--- | |
privides: [String.bound, String.prototype.bind] | |
description: Lets you bind to a method that doesn't exist yet, and then swap out methods without re-wiring all your codez | |
author: Thomas Aylott <subtlegradient.com> | |
copyright: 2009 Thomas Aylott | |
license: MIT Style | |
... | |
*/ |
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 Collection(list){ | |
this.list = $splat(list || []); | |
this.length = this.list.length; | |
}; | |
new Native({name: 'Collection', initialize: Collection, generics: false}); | |
(function() { | |
// Some browsers don't iterate over natives, so brute force is required. |
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
/* | |
--- | |
source: http://gist.github.com/133677 | |
provides: document.write | |
description: MooTools based document.write replacement | |
requires: MooTools | |
author: Thomas Aylott -- SubtleGradient.com | |
thanks: Daniel Steigerwald -- daniel.steigerwald.cz |
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(){ | |
this.Queue = new Class({ | |
Extends: Chain, | |
call: function(){ | |
if (this.busy) return this; | |
this.busy = true; |
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
$(document).bind('FB.ready',function(){ | |
console.log('FB is ready'); | |
FB.api('/me',function(response){ | |
console.log(response); | |
}); | |
}); | |
var _FB = { | |
count: 0 | |
,interval : setInterval(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
/* | |
--- | |
name: Slick.Finder | |
description: The new, superfast css selector engine. | |
provides: Slick.Finder | |
requires: Slick.Parser | |
... | |
*/ | |
(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
/** | |
* A proof of concept monkeypatch to make Cloud9 IDE work on a tablet. | |
* Since i'm an extremely lazy bastard I prepended this snippet directly in package/client/js/apf_release.js | |
* | |
* What does it do? | |
* - It fires a doubleclick for a 2-finger tap | |
* - It fires a mousewheel up / down event for a 2-finger swipe up / down. | |
* | |
* How does it work? | |
* Prepend the functions below to <cloud9>/package/client/js/apf_release.js, save, load in tablet. |
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 loader = require('../path/to/link'); | |
loader.alias('package', '../path/to/package.js'); | |
loader.alias('package2', '../path/to/package2.js'); | |
loader.base('../path/to/my/root/folder/'); | |
loader.load('main'); |
OlderNewer