This file contains 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<title>XXXX</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,maximum-scale=1"> | |
<meta name="keywords" content="XXXX,Search Keywords,XXXX"> | |
<meta name="description" content="XXXX Page description XXXX"> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> |
This file contains 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
/* ======================================== | |
イベント実装のサンプル | |
xxx.h/xxx.m イベント通知側 | |
yyy.h/yyy.m イベント受け側 | |
======================================== */ | |
/* ======================================== | |
Step1.プロトコルを定義(xxx.h はたは 別ファイル) | |
======================================== */ | |
@protocol aaaDelegate <NSObject> |
This file contains 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
/* ======================================== | |
ScreenStateLibrary.h | |
======================================== */ | |
#import <Foundation/Foundation.h> | |
@interface ScreenStateLibrary : NSObject | |
//4インチスクリーン判定 | |
//YES=4inch、NO=4inch以外(3.5inch or iPad) | |
+(BOOL)is4inch; |
This file contains 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
package com.example.myproject; | |
import com.google.appengine.api.blobstore.BlobKey; | |
import com.google.appengine.api.datastore.DatastoreService; | |
import com.google.appengine.api.datastore.DatastoreServiceFactory; | |
import com.google.appengine.api.datastore.Entity; | |
import com.google.appengine.api.datastore.EntityNotFoundException; | |
import com.google.appengine.api.datastore.Key; | |
import com.google.appengine.api.datastore.KeyFactory; |
This file contains 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
//画面解像度対応 | |
// 480x320ベースで実装を行う(iPhone 4inchのみ568x320) | |
// 画像は以下のそれぞれのフォルダより取得 | |
// @2x Resources/Published-iOS/resources-iphonehd | |
// 通常 Resources/Published-iOS/resources-iphone | |
//※AppDelegate::applicationDidFinishLaunching{} に実装する | |
// this->changeDisplayHd(); | |
void AppDelegate::changeDisplayHd() { | |
CCDirector *pDirector = CCDirector::sharedDirector(); | |
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize(); |
This file contains 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
//Facebookへの投稿 | |
//※Social.frameworkの追加が必要 | |
void postFacebook(NSString *text, NSString *url, NSString *image) { | |
SLComposeViewController *facebookPostVC = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; | |
[facebookPostVC setInitialText:text]; | |
[facebookPostVC addURL:[NSURL URLWithString:url]]; | |
[facebookPostVC addImage:[UIImage imageNamed:image]]; | |
[facebookPostVC setCompletionHandler:^(SLComposeViewControllerResult result) { | |
if (result == SLComposeViewControllerResultDone) { | |
//投稿完了の処理 |
This file contains 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
//Twitterの投稿 | |
//※Social.frameworkの追加が必要(iOS6.0以上の場合) | |
//※Twitter.frameworkの取り込みが必要(iOS5.0以下の場合) | |
void postTwitter(NSString *text, NSString *url, NSString *image) { | |
NSURL* appURL = [NSURL URLWithString:url]; | |
// iOS Version | |
NSString *iosVersion = [[[UIDevice currentDevice] systemVersion] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; | |
// Social.frameworkを使う | |
if ([iosVersion floatValue] >= 6.0) { |
This file contains 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
//Lineのテキストを投稿 | |
void postLine(NSString *text) { | |
//アプリ:LINE に直接遷移して投稿 | |
text = [text stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; | |
NSString *LINEUrlString = [NSString stringWithFormat:@"line://msg/text/%@", text]; | |
//LINEインストールの確認 | |
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:LINEUrlString]]) { | |
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:LINEUrlString]]; | |
//LINEは投稿完了を受け取れないため、メソッドコールと投稿完了がイコールとなる |
This file contains 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
//[cocos2d-x] | |
//文字列の置換 | |
//target 対象文字列 | |
//from 検索する文字列(置換される文字列) | |
//to 置換する文字列 | |
//Return 置換後文字列 | |
std::string stringReplace(const std::string target, const std::string from, const std::string to) { | |
std::string result = target; | |
std::string::size_type pos = 0; | |
while(pos = result.find(from, pos), pos != std::string::npos) { |
This file contains 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
//[cocos2d-x] | |
//トリミング関数 | |
//str 対象文字列 | |
//[trimCharacterList] トリミングしたい文字 | |
//Return トリミング後の文字列 | |
std::string trim(const std::string& str, const char* trimCharacterList = "; \t\v\r\n\"\'") { | |
std::string result; | |
std::string::size_type left = str.find_first_not_of(trimCharacterList); | |
if (left != std::string::npos) { |
OlderNewer