Skip to content

Instantly share code, notes, and snippets.

View mogeta's full-sized avatar

hiroshi mimori mogeta

View GitHub Profile
@mogeta
mogeta / org.jenkins-ci.plist
Created February 24, 2012 03:15
example plist for install jenkins for mac.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>JENKINS_HOME</key>
<string>/Users/Shared/Jenkins/Home</string>
</dict>
<key>GroupName</key>
@mogeta
mogeta / jenkins-runner.sh
Created February 24, 2012 03:24
example sh for jenkins on mac
#!/bin/bash
#
# Startup script used by Jenkins launchd job.
# Mac OS X launchd process calls this script to customize
# the java process command line used to run Jenkins.
#
# Customizable parameters are found in
# /Library/Preferences/org.jenkins-ci.plist
#
# You can manipulate it using the "defaults" utility.
@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