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
// does not work in IE | |
objectLength = function(obj) { | |
return obj.__count__; | |
} |
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
Class = function(prototype, base) { | |
var c = prototype.initialize || ( | |
base ? | |
function() { return base.apply(this, arguments); } : | |
function() {} | |
); | |
c.prototype = prototype; | |
c.prototype.constractor = c; | |
if (base) { | |
c.SUPER = base; |
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
Deferred.loop = function(n, f) { | |
var i = 0; | |
var end = new Object; | |
var ret = null; | |
return Deferred.next(function() { | |
var t = new Timer; | |
t.start(); | |
try { |
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
Timer = function() { | |
}; | |
Timer.prototype = { | |
initialize: function() { | |
this.time = []; | |
this.paused = false; | |
}, | |
stack: function() { | |
var now = (new Date()).getTime(); |
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($) { | |
var userAgent = navigator.userAgent.toLowerCase(); | |
$.extend($.browser, { | |
iphone: $.browser.safari && /iphone/.test(userAgent), | |
chrome: $.browser.safari && /chrome/.test(userAgent) | |
}); | |
})(jQuery); |
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 uri = encodeURIComponent('http://github.com/'); | |
Deferred | |
.parallel({ | |
ldc : $.getJSON('http://api.clip.livedoor.com/json/comments?callback=?&link='+uri), | |
hatebu: $.getJSON('http://b.hatena.ne.jp/entry/json/?callback=?&url='+uri) | |
}) | |
.next(function(data) { | |
$('<div><p>GitHub:</p><ul/></div>') | |
.find('ul') |
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 addCSS = function(href) { | |
$.browser.msie ? | |
document.createStyleSheet(href) : | |
$('<link rel="stylesheet" type="text/css" href="'+href+'"/>').appendTo('head'); | |
}; |
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($) { | |
$.fn.randImage = function(images) { | |
var length = images.length; | |
return this.each(function() { | |
var n = Math.floor(Math.random() * length); | |
this.src = images[n]; | |
}); | |
}; |
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
applyTemplate = (function() { | |
var markup = /#\{([^|}]+)(?:\|(.*?)\|)?\}/g; | |
return function(t, o, escape) { | |
return (!t || !o) ? | |
t : | |
t.replace(markup, function(_, prop, alt) { | |
prop = o[prop]; | |
if (!prop && prop !== '' && prop !== 0) | |
prop = alt || ''; | |
return escape ? prop.escapeTag() : prop; |
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
p = function() { | |
if (typeof console != 'undefined' && typeof console.log == 'function') | |
console.log.apply(null, arguments); | |
}; | |
Grayback = (function() { | |
var id = 1; | |
var stack = []; |