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
# coding: utf-8 | |
require 'rubygems' | |
require 'aws-sdk' | |
require 'net/ssh' | |
config = {:access_key_id => 'アクセスキー ID', | |
:secret_access_key => 'シークレットアクセスキー'} | |
AWS.config(config) | |
ec2 = AWS::EC2.new |
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
# coding: utf-8 | |
require 'rubygems' | |
require 'aws-sdk' | |
config = {:access_key_id => 'アクセスキー ID', | |
:secret_access_key => 'シークレットアクセスキー'} | |
AWS.config(config) | |
hosts = [] | |
hosts << "127.0.0.1\tlocalhost localhost.localdomain" |
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
// ■変数宣言 | |
// 1. *の前にスペース。後には入れない | |
// 2. 代入演算子の前後にスペース | |
◯ | |
NSString *string = [[NSString alloc] initWithString:@"string"]; | |
☓ | |
NSString* string = [[NSString alloc] initWithString:@"string"]; | |
◯ |
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
1. initXXXメソッドは呼び出し側がrelease/autoreleaseする | |
2. 1以外のメソッドはメソッド側でautoreleaseした変数を返す | |
=> frameworkもこの原則を守っている | |
3. retain/copyした変数は、retain/copyした側が責任を持ってreleaseする | |
4. NSMutableArrayなどにaddObjectした変数はaddObject後にrelease可能 | |
=> autorelease済みならばreleaseしてはダメ | |
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
1. 作業完了したブランチをレビュー用リモートブランチへ送る | |
git co BRANCH_NAME | |
git push origin BRANCH_NAME:review/NAME/BRANCH_NAME | |
※NAMEの部分はユーザ名 | |
2. レビューしてねと伝える | |
review/NAME/BRANCH_NAMEをレビューして下さいと伝える |
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
1. review/NAME/BRANCH_NAMEをレビューして下さいと依頼を受ける | |
2. ローカルのブランチへ取得 | |
git co -b review origin/review/NAME/BRANCH_NAME | |
3. 差分をチェック | |
(1) メールで指摘する | |
(2) 修正したよ!って言われた | |
git pull |
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
【参考】 | |
http://d.hatena.ne.jp/hnw/20110528 | |
【事前準備】 | |
1. forkする | |
githubのページから | |
2. fork元の変更を取り込めるようにremote add | |
git remote add upstream git://github.com:328w/XXXX.git |
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)doSomething { | |
[self performSelectorInBackground:@selector(doSomethingInBackground) withObject:nil]; | |
} | |
- (void)doSomethingInBackground { | |
NSLog(@"バックグラウンド処理でごにょごにょ"); | |
} |
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 NSObject (Extensions) | |
typedef void (^VoidBlock)(void); | |
- (void)performBlockInBackground:(VoidBlock)block; | |
@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
#import "NSObject+Extensions.h" | |
@implementation NSObject (Extensions) | |
- (void)performBlockInBackground:(VoidBlock)block { | |
[self performSelectorInBackground:@selector(executeBlockInAutoReleasePool:) withObject:[block copy]]; | |
} | |
- (void)executeBlockInAutoReleasePool:(VoidBlock)block { | |
@autoreleasepool { |
OlderNewer