Skip to content

Instantly share code, notes, and snippets.

#なんだかんだ

##えーと1 どういうこういう そういうどういう

##えーと2 どういうこういう そういうどういう

@satoshin2071
satoshin2071 / gist:6915271
Created October 10, 2013 08:58
[メモ] blocksでselfを使うとき
//weakだと、blokcksに入って、叩くまでの間に開放され得るらしく、叩く場合は、strongに代入
__weak Hoge *weakSelf = self;
blocks = ^(void)
{
__strong Hoge *strongSelf = weakSelf;
[strongSelf hogeWithHoge:4126]
strongSelf = nil;
};
@satoshin2071
satoshin2071 / gist:7207567
Created October 29, 2013 01:05
XCode5でcocoaPodsを使う
cocoaPod使ってるプロジェクトをXcode5でArchiveしようとすると
依存する-lPods.aがみつからないって怒られる
ld: library not found for -lPods
解決策
Pods (the project) -> Pods (the target) -> Build settings -> Architectures
をarmv7のものに直す。
参考
https://github.com/CocoaPods/CocoaPods/pull/1352
*markdown-cheat-sheet.jax* Markdown カンニングペーパー
作者: Kyo Nagashima <kyo@hail2u.net>
バージョン: 0.04
説明: Markdown 記法のカンニングペーパーです。
1. 記法の例 |markdown-cheat-sheet-examples|
1.1 段落 |markdown-cheat-sheet-paragraph|
1.2 改行 |markdown-cheat-sheet-linebreak|
1.3 テキストの強調 |markdown-cheat-sheet-emphasis|
@satoshin2071
satoshin2071 / gist:7460424
Created November 14, 2013 02:39
[ObjC][plist][基本]plistから読み込んだ文字列を改行
//読み込んだ際に改行コードがエスケープされてしまうので、置換する
myTextField.text = [dbString stringByReplacingOccurrencesOfString: @"\\n" withString: @"\n"];
@satoshin2071
satoshin2071 / gist:7576814
Last active December 28, 2015 23:09
[基本]再帰的にgrep
find ./ -name '*' | xargs grep hogehoge
拡張子がrbのものだけならば、以下のようにする。
find ./ -name '*.rb' | xargs grep hogehoge
@satoshin2071
satoshin2071 / UIView+FadeAnimation.h
Last active December 28, 2015 23:18
[ObjC][Sample]UIViewアニメーションでフェードイン/フェードアウト
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@interface UIView (FadeAnimation)
- (void)fadeIn;
- (void)fadeOut;
@end
@satoshin2071
satoshin2071 / gist:7596884
Last active December 29, 2015 01:59
[ObjC][便利系]iOS判定マクロ
//OS判定
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
//iOS7.x以上か?
#define isiOS7 SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")
@satoshin2071
satoshin2071 / gist:7690341
Last active December 29, 2015 15:19
[ObjC][基本]hogeプロパティ.delegate = selfとしたい時
//以下でIncompatible pointer types消える
self.hoge.delegate = (id<hogeDelegate>)self;
@satoshin2071
satoshin2071 / 0_reuse_code.js
Created December 18, 2013 09:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console