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
var a = getComputedStyle(document.getElementById("navbar")) |
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
var linkHref = link.getAttributeNode('href').nodeValue; |
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
if ([[FBSession activeSession]isOpen]) { | |
/* | |
* if the current session has no publish permission we need to reauthorize | |
*/ | |
if ([[[FBSession activeSession]permissions]indexOfObject:@"publish_actions"] == NSNotFound) { | |
[[FBSession activeSession] requestNewPublishPermissions:[NSArray arrayWithObject:@"publish_action"] defaultAudience:FBSessionDefaultAudienceFriends | |
completionHandler:^(FBSession *session,NSError *error){ | |
[self postPhoto]; | |
}]; |
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
UIImage *originalImage = [UIImage imageNamed:@"categories_button_scalable_bg"]; | |
[self.categoriesButton setBackgroundImage: [originalImage stretchableImageWithLeftCapWidth:6 topCapHeight:6] forState:UIControlStateNormal]; |
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
// Evalulates a script in a global context | |
// Evaluates Async. in Safari 2 :-( | |
globalEval: function( data ) { | |
data = jQuery.trim( data ); | |
if ( data ) { | |
if ( window.execScript ) | |
window.execScript( data ); | |
else if ( jQuery.browser.safari ) | |
// safari doesn't provide a synchronous global eval |
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 addMethod(object,name,fn){ | |
var old = object[name]; | |
object[name] = function() { | |
if(fn.length == arguments.length){ | |
return fn.apply(this,arguments); | |
} | |
else if(typeof old == "function"){ | |
return old.apply(this,arguments); | |
} | |
}; |
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
li { | |
background: | |
url(data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7) | |
no-repeat | |
left center; | |
padding: 5px 0 5px 25px; | |
} |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> | |
<title>Show File Data</title> | |
<style type='text/css'> | |
body { | |
font-family: sans-serif; | |
} | |
</style> |
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
- (void)sessionStateChanged:(FBSession *)session | |
state:(FBSessionState) state | |
error:(NSError *)error | |
{ | |
switch (state) { | |
case FBSessionStateOpen: { | |
//open! | |
} | |
break; | |
case FBSessionStateClosed: |
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
NSString* emailString = @"[email protected]"; | |
NSString *emailRegEx = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; | |
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegEx]; | |
[emailTest evaluateWithObject:emailString]; //returns BOOL |