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
# Git settings | |
# Git bashの場合は下記2行を削除またはコメントアウトしてください。 | |
source ./git-prompt.sh | |
source ./git-completion.bash | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export GIT_PS1_SHOWSTASHSTATE=1 | |
export GIT_PS1_SHOWUNTRACKEDFILES=1 | |
export GIT_PS1_SHOWUPSTREAM="auto" |
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
<?php | |
// Here your code ! | |
$originCode = array(3, 5, 7); | |
$testNumber = array( 3, 5 ); | |
$testNumberIndex = array(0, 0); | |
$testNumberAnswer = array(); | |
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
require 'rubygems' | |
require 'apns' | |
#APNS.host = 'gateway.sandbox.push.apple.com' | |
APNS.host = 'gateway.push.apple.com' # プロダクションの場合 | |
APNS.port = 2195 | |
APNS.pem = 'xxx_apns_test.pem' | |
device_token = '{取得したdevice_token}' |
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
extension String : CollectionType{} | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
... | |
//DB初期データ | |
func setDefaultData() { | |
var memos:[Memo]! = Memo.MR_findAll() as! [Memo] | |
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
//Memoテーブルに保存。 | |
//構造は title:String, value:String | |
var memos:[Memo]! = Memo.MR_findAll() as! [Memo] | |
if let first = memos?.first { | |
//データが存在した場合は初期化しない | |
} else { | |
//データ取得できなかった場合、初期データ挿入 | |
let filePath = NSBundle.mainBundle().pathForResource("Memo", ofType: "csv") | |
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
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
// Override point for customization after application launch. | |
//push通知の許可 | |
if( application.respondsToSelector("registerUserNotificationSettings:")) { | |
// iOS8 | |
let types:UIUserNotificationType = (.Alert | .Badge | .Sound ) | |
let settings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: nil) | |
application.registerUserNotificationSettings(settings) |
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
//文字列を置換する | |
std::string CommonWord::ReplaceString( std::string String1, std::string String2, std::string String3 ) | |
{ | |
std::string::size_type Pos( String1.find( String2 ) ); | |
while( Pos != std::string::npos ) | |
{ | |
String1.replace( Pos, String2.length(), String3 ); | |
Pos = String1.find( String2, Pos + String3.length() ); | |
} |