This file contains hidden or 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.prototype.before = function(methodName, newFunc) { | |
if(typeof this == "function") { | |
var oldFunc = this.prototype[methodName]; | |
this.prototype[methodName] = function() { | |
newFunc.apply(this, arguments); | |
return oldFunc.apply(this, arguments); | |
}; | |
} else if(typeof this == "object") { | |
var oldFunc = instance[methodName]; | |
instance[methodName] = function() { |
This file contains hidden or 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
<script> | |
Function.prototype.before = function(methodName, newFunc) { | |
var oldFunc = this[methodName]; | |
console.debug(oldFunc) | |
}; | |
function someObject() |
This file contains hidden or 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.prototype.before = function() { | |
console.debug('before') | |
}; | |
function someObject() | |
{ | |
this.before = Function.prototype.before | |
} |
This file contains hidden or 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
@font-face | |
{ | |
font-family: "Delicious"; | |
src: url("/fonts/delicious.otf"); | |
} | |
body | |
{ | |
font-family: "Delicious", "Helvetica Neue", Arial, sans-serif; | |
} |
This file contains hidden or 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
<script> | |
//#function | |
function track_event(category, action, label) | |
{ | |
if(window.pageTracker) { | |
pageTracker._trackEvent(category, action, label); | |
} | |
} |
This file contains hidden or 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 publish/subscribe by Mark Meyer | |
- http://markdotmeyer.blogspot.com/2008/09/jquery-publish-subscribe.html | |
jQuery unsubscribe by Zach Holmquist | |
*/ | |
jQuery.subscribe = function( eventName, obj, method ){ | |
$(window).bind( eventName, function() { | |
obj[method].apply( obj, Array.prototype.slice.call( arguments, 1 ) ); | |
}); | |
return jQuery; |
NewerOlder