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
/* | |
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; |
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
<script> | |
//#function | |
function track_event(category, action, label) | |
{ | |
if(window.pageTracker) { | |
pageTracker._trackEvent(category, action, label); | |
} | |
} |
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
@font-face | |
{ | |
font-family: "Delicious"; | |
src: url("/fonts/delicious.otf"); | |
} | |
body | |
{ | |
font-family: "Delicious", "Helvetica Neue", Arial, sans-serif; | |
} |
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.prototype.before = function() { | |
console.debug('before') | |
}; | |
function someObject() | |
{ | |
this.before = Function.prototype.before | |
} |
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
<script> | |
Function.prototype.before = function(methodName, newFunc) { | |
var oldFunc = this[methodName]; | |
console.debug(oldFunc) | |
}; | |
function someObject() |
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.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 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
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation | |
{ | |
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || | |
(interfaceOrientation == UIInterfaceOrientationLandscapeRight); | |
} |
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
/* netflix oauth */ | |
this.beginNetflixOAuth = function() | |
{ | |
var popupParams = 'location=0,status=0,width=320,height=480'; | |
self._netflixWindow = window.open('/login/', 'netflixWindow', popupParams); | |
self._netflixInterval = window.setInterval(self.completeNetflixConnect, 1000); | |
self.logEvent('Authentication', 'netflix', 'begin') | |
}; | |
/* netflix is complete. */ |
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
/* | |
canOpenURL | |
Clear App ( http://www.realmacsoftware.com/clear/ ) checks if app exsits, | |
then unlocks a theme based on that app. In Clear, they check if you have | |
Tweetbot. | |
Example Usage: | |
BOOL hasTweetbotInstalled = [self checkIfPhoneCanOpenAppUrlScheme:@"tweetbot://"]; |
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
# Paste URL into your browser of choice. | |
# Note, this only works with single words due to the way Giphy does searches. | |
alfred://customsearch/Gif%20tagged%20%27%7Bquery%7D%27/gif/utf8/noplus/http://giphy.com/tags/{query} |
OlderNewer