Skip to content

Instantly share code, notes, and snippets.

View norio-nomura's full-sized avatar

Norio Nomura norio-nomura

View GitHub Profile
@norio-nomura
norio-nomura / gist:727134f61c70b0ca62d8
Created May 23, 2015 01:00
Carthage 0.6.4をHomebrewでインストール
brew install https://github.com/Homebrew/homebrew/raw/cf9ac58c59290ce72da996cd2d36ecbfdc1d75d2/Library/Formula/carthage.rb
@norio-nomura
norio-nomura / demangled
Last active August 29, 2015 14:22
Crash on testing Carthage#497
Process: carthage [8092]
Path: /Users/USER/Library/Developer/Xcode/DerivedData/Carthage-bliqitahmqdopabqxfgvfxzydaql/Build/Products/Debug/carthage
Identifier: carthage
Version: 0
Code Type: X86-64 (Native)
Parent Process: zsh [58872]
Responsible: Terminal [58599]
User ID: 501
Date/Time: 2015-05-29 11:00:10.365 +0900
@norio-nomura
norio-nomura / allTimeZoneInfomations.csv
Last active August 29, 2015 14:25
All timezones supported by OS X 10.10
name standard name(en_US) standard name(ja_JP) short transition dates
Africa/Abidjan Greenwich Mean Time グリニッジ標準時 GMT
Africa/Accra Greenwich Mean Time グリニッジ標準時 GMT
Africa/Addis_Ababa East Africa Time 東アフリカ時間 GMT+3
Africa/Algiers Central European Standard Time 中央ヨーロッパ標準時 GMT+1
Africa/Asmara East Africa Time 東アフリカ時間 GMT+3
Africa/Bamako Greenwich Mean Time グリニッジ標準時 GMT
Africa/Bangui West Africa Standard Time 西アフリカ標準時 GMT+1
Africa/Banjul Greenwich Mean Time グリニッジ標準時 GMT
Africa/Bissau Greenwich Mean Time グリニッジ標準時 GMT
@norio-nomura
norio-nomura / nscurl-verbose.log
Last active August 29, 2015 14:25
nscurl --verbose --ats-diagnostics https://www.reddit.com
Starting ATS Diagnostics
Configuring ATS Info.plist keys and displaying the result of HTTPS loads to https://www.reddit.com.
A test will "PASS" if URLSession:task:didCompleteWithError: returns a nil error.
================================================================================
Default ATS Secure Connection
---
ATS Default Connection
ATS Dictionary:
@norio-nomura
norio-nomura / gist:62940
Created February 12, 2009 23:29
wait NSURLConnection's finish
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]]);
@norio-nomura
norio-nomura / UIWebView target="_blank" hack
Created February 13, 2009 07:23
UIWebView target="_blank" hack
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, "@@:@@");
//
// Reachability.h
//
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
@interface Reachability : NSObject {
NSString *hostName;
SCNetworkReachabilityFlags reachabilityFlags;
@norio-nomura
norio-nomura / blockPromotedTweetOnTwitter.json
Created September 1, 2015 11:17
twitter.comのpromoted tweetを非表示にするSafari Content Blocker Extensionのルール
[
{
"action": {
"type": "css-display-none",
"selector": ".promoted-tweet"
},
"trigger": {
"url-filter": ".*",
"if-domain": ["twitter.com"]
}
@norio-nomura
norio-nomura / SecItemDelete sample
Created February 23, 2010 01:36
SecItemDelete sample
- (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];
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)