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
NSString *connectionRunLoopMode = @"connectionRunLoopMode"; | |
NSURLConnection *connection = [[NSURLConnection alloc]initWithRequest:urlRequest delegate:urlConnectionDelegate startImmediately:NO]; | |
NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop]; | |
[connection unscheduleFromRunLoop:currentRunLoop forMode:NSDefaultRunLoopMode]; | |
[connection scheduleInRunLoop:currentRunLoop forMode:connectionRunLoopMode]; | |
[connection start]; | |
while ([currentRunLoop runMode:connectionRunLoopMode beforeDate:[NSDate distantFuture]]); |
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
static NSObject *webViewcreateWebViewWithRequestIMP(id self, SEL _cmd, NSObject* sender, NSObject* request) { | |
return [sender retain]; | |
} | |
Class UIWebViewWebViewDelegate = objc_getClass("UIWebViewWebViewDelegate"); | |
class_addMethod(UIWebViewWebViewDelegate, @selector(webView:createWebViewWithRequest:), (IMP)webViewcreateWebViewWithRequestIMP, "@@:@@"); |
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
// | |
// Reachability.h | |
// | |
#import <Foundation/Foundation.h> | |
#import <SystemConfiguration/SystemConfiguration.h> | |
@interface Reachability : NSObject { | |
NSString *hostName; | |
SCNetworkReachabilityFlags reachabilityFlags; |
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
- (void)removeObjectForKey:(NSString*)key { | |
#if !TARGET_IPHONE_SIMULATOR | |
@synchronized(self) { | |
if (!deleteQueryDictionary) { | |
deleteQueryDictionary = [[NSMutableDictionary alloc]initWithObjectsAndKeys: | |
(id)kSecClassGenericPassword, (id)kSecClass, | |
key, (id)kSecAttrAccount, | |
(id)kSecMatchLimitAll, (id)kSecMatchLimit, | |
(id)kCFBooleanTrue, (id)kSecReturnAttributes, | |
nil]; |
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
javascript:var%20d=document,w=window,enc=encodeURIComponent,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),s2=((s.toString()=='')?s:('%22'+enc(s)+'%22%20')),f='echofon:',l=d.location,p=enc(d.title)+'%20'+s2+enc(l.href),u=f+p;try%7Bif(!/%5E(.*%5C.)?tumblrzzz%5B%5E.%5D*$/.test(l.host))throw(0);tstbklt();%7Dcatch(z)%7Ba%20=function()%7Bwindow.location=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();%7Dvoid(0) |
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
#!/usr/bin/env ruby | |
# | |
# gem install plist | |
# | |
# On Xcode, right-click on your Target where you want to use this and select | |
# Add->New Build Phase->New Run Script Build Phase. | |
# | |
# Set the Shell to | |
# /usr/bin/ruby | |
# |
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
javascript:var c='login=YOUR_LOGIN_HERE&apiKey=YOUR_API_KEY_HERE',d=document,w=window,enc=encodeURIComponent,j=w.getSelection,k=d.getSelection,x=d.selection,s=(j?j():(k?k():(x?x.createRange().text:0))),s2=((s.toString()=='')?s:('"'+enc(s)+'" ')),l=d.location,e=d.createElement('script'); | |
if(typeof(BitlyCB)=='undefined')var BitlyCB={}; | |
BitlyCB.shortenResponse=function(r){ | |
if (r.status_code==200) { | |
p=enc(d.title)+' '+s2+enc(r.data.url),u='echofon:'+p; | |
try{if(!/^(.*\.)?tumblrzzz[^.]*$/.test(l.host))throw(0);tstbklt();} | |
catch(z){ | |
a=function(){w.location=u;}; | |
if(/Firefox/.test(navigator.userAgent))setTimeout(a,0); | |
else a(); |
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
javascript:window.opener=window;var%20win=window.open(location.href,%22_self%22);win.close(); |
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
#import <Foundation/Foundation.h> | |
@interface Oyakata : NSObject { int gakkari; } | |
@property int gakkari; | |
@end | |
@implementation Oyakata | |
@synthesize gakkari; | |
@end |
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
javascript:(function(){ | |
var w=window,enc=encodeURIComponent; | |
if (w.ustream && w.ustream.vars.liveHttpUrl) { | |
var u='airflick://play-media?MediaLocation='+enc(w.ustream.vars.liveHttpUrl), | |
a=function(){w.location=u;}; | |
if(/Firefox/.test(navigator.userAgent))setTimeout(a,0); | |
else a(); | |
} else { | |
alert('this ustream is not compatible with Apple TV!'); | |
} |
OlderNewer