Skip to content

Instantly share code, notes, and snippets.

View zholmquist's full-sized avatar
🌐
OrcaPanda.

Zach Holmquist zholmquist

🌐
OrcaPanda.
View GitHub Profile
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() {
<script>
Function.prototype.before = function(methodName, newFunc) {
var oldFunc = this[methodName];
console.debug(oldFunc)
};
function someObject()
Function.prototype.before = function() {
console.debug('before')
};
function someObject()
{
this.before = Function.prototype.before
}
@font-face
{
font-family: "Delicious";
src: url("/fonts/delicious.otf");
}
body
{
font-family: "Delicious", "Helvetica Neue", Arial, sans-serif;
}
<script>
//#function
function track_event(category, action, label)
{
if(window.pageTracker) {
pageTracker._trackEvent(category, action, label);
}
}
/*
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;