Skip to content

Instantly share code, notes, and snippets.

@ttsubono
ttsubono / WIP-chrome-cheatsheet.md
Last active December 28, 2017 03:40
Chrome Cheatsheet(Mac)

Window

Cmd+N New
Cmd+Shift+N New(incognite mode)
Cmd+Shift+W Close

Tab

Cmd+T           New
Cmd+Shift+T Last closed tab

= |

Container (info)

docker ps                  List running containers
docker ps -a               List all containers
docker diff <Container>    Show changes to files
docker inspect <Container> Show container info
docker logs <Container>    Show logs
docker port <Container>    List port mapping
docker top  Show running proceess
@ttsubono
ttsubono / tmux-cheatsheet.md
Last active January 26, 2018 12:16
tmux cheatsheet

Basic

Start

tmux                          Create a new session
tmux new -s <name>            Create a new session with name
tmux new -As <name>           Create a new session with name or attach if the name exists
tmux ls                       List sessions
tmux a                        Attach last session
tmux a -t <name>              Attach a session with name
@ttsubono
ttsubono / gist:4593667
Created January 22, 2013 10:33
よく使うフォント名
/** よく使うフォント名 */
#define HIRAKAKU_FONT @"HiraKakuProN-W3"
#define HIRAKAKU_FONT_BOLD @"HiraKakuProN-W6"
#define HIRAMIN_FONT @"HiraMinProN-W3"
#define HIRAMIN_FONT_BOLD @"HiraMinProN-W6"
#define ARIAL_FONT @"ArialMT"
#define ARIAL_FONT_BOLD @"Arial-BoldMT"
@ttsubono
ttsubono / gist:4593656
Created January 22, 2013 10:31
画面の主要パーツの高さ
/** 画面の主要パーツの高さ */
#define NAVIGATION_BAR_HEIGHT 44.0f
#define TAB_BAR_HEIGHT 49.0f
#define STATUS_BAR_HEIGHT 20.0f
#define PAGE_CONTROL_HEIGHT 18.0f
@ttsubono
ttsubono / gist:4593627
Last active December 11, 2015 11:28
画面系の便利関数
/** 4インチ画面ならtrue */
#define IS_4INCH_SCREEN (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)568) < DBL_EPSILON)
/** 画面高(ステータスバー領域を含まない) */
#define SCREEN_HEIGHT CGRectGetHeight([UIScreen mainScreen].applicationFrame)
/** 画面幅 */
#define SCREEN_WIDTH CGRectGetWidth([UIScreen mainScreen].applicationFrame)
@ttsubono
ttsubono / gist:4057699
Created November 12, 2012 05:46
NavigationBarに閉じるボタンを置く
UIBarButtonItem *closeButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"閉じる"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(close:)];
self.navigationItem.leftBarButtonItem = closeButtonItem;
[closeButtonItem release];
@ttsubono
ttsubono / gist:3140938
Created July 19, 2012 05:21
端末のiOSのバージョンにより処理を分岐する
#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)
@ttsubono
ttsubono / gist:3135652
Created July 18, 2012 11:21
MapViewでpinが落ちてくるアニメーション
// これを適当なメソッドにして、CustomAnnotationViewにセットし、MKMapViewDelegateのmapView:didAddAnnotationViews
// でそのメソッドを呼び出すか、CustomAnnoationViewのdidMoveToSuperviewメソッドにセットする。
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.duration = 0.4;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn];
animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeTranslation(0, -400, 0)];
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
CABasicAnimation *animation2 = [CABasicAnimation animationWithKeyPath:@"transform"];
@ttsubono
ttsubono / gist:3081457
Created July 10, 2012 06:03
setterをoverrideするときの基本的な記述方法
//
// override a setter
//
// NSStringはcopyするという記事もあるが、copyもretainも同じ。
// you do not need to make a copy when Foo is a NSString.
// "copy" and "retain" for NSString are internally the same action.
- (void)setFoo:(Foo *)aFoo {
if (aFoo != foo) {
[foo release];
foo = [aFoo retain];