Skip to content

Instantly share code, notes, and snippets.

Avatar

hiroshi mimori mogeta

View GitHub Profile
@mogeta
mogeta / org.jenkins-ci.plist
Created Feb 24, 2012
example plist for install jenkins for mac.
View org.jenkins-ci.plist
<?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 Feb 24, 2012
example sh for jenkins on mac
View jenkins-runner.sh
#!/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 Feb 28, 2012
jenkins tips
View shell
cp ${JENKINS_HOME}/userContent/proguard.cfg proguard.cfg
@mogeta
mogeta / getWidth
Created Mar 22, 2012
get width in iOS
View getWidth
NSInteger width = [[UIScreen mainScreen] applicationFrame].size.width;
@mogeta
mogeta / actionsheet.m
Created Mar 26, 2012
action sheet with toolbar
View actionsheet.m
//OK
[sheet showInView:[UIApplication sharedApplication].keyWindow];
//NG
[sheet showInView: someViewController.view];
@mogeta
mogeta / gist:2573805
Created May 2, 2012
performSelector:withObject:afterDelay recursive call
View gist:2573805
- (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
setNeedsDisplay on MainThread
View gist:2632666
- (void) refreshUIViewOnMainThread:(UIView*)view{
[view performSelectorOnMainThread:@selector(setNeedsDisplay)
withObject:nil
waitUntilDone:YES];
}
View gist:2692588
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>
View gist:2760211
git config --global color.ui true
@mogeta
mogeta / MyOpenGLView.h
Created Aug 21, 2012
Drawing to a Window or View
View MyOpenGLView.h
#import <Cocoa/Cocoa.h>
@interface MyOpenGLView : NSOpenGLView
{
}
- (void) drawRect: (NSRect) bounds;
@end