This file contains hidden or 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
glColor4ub(255, 0, 0, 255); | |
CGPoint vertices3[] = { ccp(100,100), ccp(200,100), ccp(200,200) }; | |
fillTriangles(vertices3, 3); |
This file contains hidden or 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
// @interface MyLayer : Layer | |
- (BOOL)ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
UITouch *touch = [touches anyObject]; | |
CGPoint touchLocation = [touch locationInView: [touch view]]; | |
touchLocation = [[Director sharedDirector] convertCoordinate: touchLocation]; | |
CGPoint location = ccp(touchLocation.x, touchLocation.y); | |
CGRect rect = CGRectMake(self.position.x - SIZE / 2, self.position.y - SIZE / 2, SIZE, SIZE); |
This file contains hidden or 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 <QuartzCore/QuartzCore.h> | |
- (UIImage*) buildImageFrom: (UIView*)view { | |
UIGraphicsBeginImageContext(view .bounds.size); | |
[view.layer renderInContext:UIGraphicsGetCurrentContext()]; | |
UIImage* viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
return viewImage; | |
} |
This file contains hidden or 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
@interface MainScene : Scene { | |
ColorLayer* colorLayer_; | |
} | |
@property (nonatomic, retain) ColorLayer *colorLayer; | |
@end | |
@implementation MainScene |
This file contains hidden or 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
myStr = "2008" + "年"; | |
myXList += <item>値1</item>; | |
myXML = <foo><bar>値1</bar></foo>; | |
myStr = myXML.bar; | |
delete myXML.bar; |
This file contains hidden or 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
;; for changelog memo | |
(setq user-full-name "akio0911") | |
(setq user-mail-address "[email protected]") | |
(defun memo () | |
(interactive) | |
(add-change-log-entry | |
nil | |
(expand-file-name "~/Dropbox/changelog.txt"))) | |
(define-key ctl-x-map "M" 'memo) |
This file contains hidden or 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
# git のブランチ名前を表示 | |
_set_env_git_current_branch() { | |
GIT_CURRENT_BRANCH=$( git branch &> /dev/null | grep '^\*' | cut -b 3- ) | |
} | |
_update_rprompt () { | |
if [ "`git ls-files 2>/dev/null`" ]; then | |
RPROMPT="[%~:$GIT_CURRENT_BRANCH]" | |
else | |
RPROMPT="[%~]" |
This file contains hidden or 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
for fname in *.m4a ; do | |
res=`expr $fname : "hogehoge_\(.*\)_"` | |
mv $fname fuga-0${res}.m4a; | |
done |
This file contains hidden or 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
<font> | |
</font> |
This file contains hidden or 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
@interface MentionViewController : UITableViewController | |
{ | |
NSMutableArray *statuses; | |
} |