Skip to content

Instantly share code, notes, and snippets.

@Seasons7
Seasons7 / shakeAnimation.js
Created September 24, 2011 10:05
Shake animation that like editing of home screen.
function shakeAnimation(view) {
view.transform = Ti.UI.create2DMatrix().rotate(1);
var r1 = Ti.UI.create2DMatrix().rotate(2);
var r2 = Ti.UI.create2DMatrix().rotate(-2);
var anim1 = Ti.UI.createAnimation({
duration:200,
transform:r1,
});
var anim2 = Ti.UI.createAnimation({
@Seasons7
Seasons7 / app.js
Created October 30, 2011 13:27
Titanium Growl Animation
Titanium.UI.setBackgroundColor('#000');
var window = Ti.UI.createWindow({
title:'テスト',
backgroundColor:'#FFF'
});
var label = Ti.UI.createLabel({
bottom:0,
color:'#FFF',
@Seasons7
Seasons7 / rate.m
Created April 14, 2012 05:01
call AppStore rating page.
// jump to AppStore review page
- (void)rate:(int)appID {
NSString *url = [NSString stringWithFormat:@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%d",appID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
- (IBAction)rateNow:(id)sender {
@Seasons7
Seasons7 / HelloWorldLayer.m
Created September 28, 2012 07:23
CCTransitionZoomFlipXSample
//
// HelloWorldLayer.m
// aaaa
//
// Created by hatakeis on 2012/09/28.
// Copyright __MyCompanyName__ 2012年. All rights reserved.
//
// Import the interfaces
@Seasons7
Seasons7 / CardFlip.js
Created November 8, 2012 20:52
CardFlip for cocos2d jsb
//------------------------------------------------------------------
//
// JavaScript sample
//
//------------------------------------------------------------------
//
// For a more complete sample, see "JS Watermelon With Me" bundled with cocos2d-iphone
//
@Seasons7
Seasons7 / seasons.js
Created November 19, 2012 23:37
dynamic new js object
var Seasons = function(){
this.name = "keisuke hata";
}
Seasons.prototype.sayHello = function() {
print("こんにちは!!");
}
@Seasons7
Seasons7 / Monokai.theme.patch
Created December 14, 2012 17:24
SublimeText2 Block Cursor Color
<dict>
<key>name</key>
<string>Block Cursor</string>
<key>scope</key>
<string>block_cursor</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FFFFFF</string>
<key>background</key>
@Seasons7
Seasons7 / addFile.py
Created March 16, 2013 17:05
add file in subgroup
from mod_pbxproj import XcodeProject
if __name__ == '__main__':
proj = XcodeProject.Load('test01.xcodeproj/project.pbxproj')
test01 = proj.get_or_create_group("test01")
resources = proj.get_or_create_group("Resources", parent=test01)
proj.add_file("hoge/a.txt", parent=resources)
proj.backup()
proj.save()
@Seasons7
Seasons7 / addResource.py
Created March 16, 2013 17:42
add resources in xcodeproj
def add_resources(proj):
test01 = proj.get_or_create_group("test01")
resources = proj.get_or_create_group("Resources", parent=test01)
# res = proj.get_or_create_group("res", parent=resources)
proj.add_folder("test01/Resources/res", parent=resources)
@Seasons7
Seasons7 / hello.js
Created August 24, 2013 16:48
JSBSample01 simple hello.js
require("jsb.js");
try {
director = cc.Director.getInstance();
winSize = director.getWinSize();
centerPos = cc.p( winSize.width/2, winSize.height/2 );
var GameLayer = cc.Layer.extend({