Skip to content

Instantly share code, notes, and snippets.

View mogeta's full-sized avatar

hiroshi mimori mogeta

View GitHub Profile
@mogeta
mogeta / readme.md
Last active August 29, 2015 14:24
WebStorm の CheatSheet

WebStorm の CheatSheet

  • shift 2回で search everywhere

  • actionやcodeネームを検索して実行出来る

  • command + shift + A

  • Go fmt

  • command + alt + shift + F

@mogeta
mogeta / shell
Created February 28, 2012 07:29
jenkins tips
cp ${JENKINS_HOME}/userContent/proguard.cfg proguard.cfg
@mogeta
mogeta / getWidth
Created March 22, 2012 06:32
get width in iOS
NSInteger width = [[UIScreen mainScreen] applicationFrame].size.width;
@mogeta
mogeta / actionsheet.m
Created March 26, 2012 03:27
action sheet with toolbar
//OK
[sheet showInView:[UIApplication sharedApplication].keyWindow];
//NG
[sheet showInView: someViewController.view];
@mogeta
mogeta / gist:2573805
Created May 2, 2012 04:50
performSelector:withObject:afterDelay recursive call
- (void)advTimeKeeper:(NSNumber * )param{
[NSThread sleepForTimeInterval:0.1];
[self performSelectorInBackground:@selector(progress:)
withObject:[NSNumber numberWithFloat:[param floatValue]]];
if([param floatValue]<1.0){
[self performSelector:@selector(advTimeKeeper:)
withObject:[NSNumber numberWithFloat:([param floatValue]+0.03125)]];
           //not work afterDelay
}
@mogeta
mogeta / gist:2632666
Created May 8, 2012 04:48
setNeedsDisplay on MainThread
- (void) refreshUIViewOnMainThread:(UIView*)view{
[view performSelectorOnMainThread:@selector(setNeedsDisplay)
withObject:nil
waitUntilDone:YES];
}
@mogeta
mogeta / gist:2692588
Created May 14, 2012 07:59
easy miss
NSURLResponse* response=nil;// not =nil;
NSError* error;
NSURL* url = [NSURL URLWithString:@"http://hogehoge"];
NSURLRequest* request = [NSURLRequest requestWithURL:url];
[NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];
NSLog(@"%@",response);// <null>
@mogeta
mogeta / gist:2760211
Created May 21, 2012 01:28
git config
git config --global color.ui true
@mogeta
mogeta / MyOpenGLView.h
Created August 21, 2012 00:29
Drawing to a Window or View
#import <Cocoa/Cocoa.h>
@interface MyOpenGLView : NSOpenGLView
{
}
- (void) drawRect: (NSRect) bounds;
@end
//スプライトを回転
pSprite->setRotation(90);