Skip to content

Instantly share code, notes, and snippets.

ryokwkm ryokwkm

Block or report user

Report or block ryokwkm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .bashrc
# 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"
View Main.php
<?php
// Here your code !
$originCode = array(3, 5, 7);
$testNumber = array( 3, 5 );
$testNumberIndex = array(0, 0);
$testNumberAnswer = array();
View push_test.rb
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}'
@ryokwkm
ryokwkm / appDelegate.swift
Last active Dec 17, 2015
[swift2.0] CSVデータによるCoreDataの初期化[MagicalRecord]
View appDelegate.swift
extension String : CollectionType{}
class AppDelegate: UIResponder, UIApplicationDelegate {
...
//DB初期データ
func setDefaultData() {
var memos:[Memo]! = Memo.MR_findAll() as! [Memo]
@ryokwkm
ryokwkm / initializeDatabaseByCsvFile.swift
Last active Dec 3, 2015
ファイルを読み込む
View initializeDatabaseByCsvFile.swift
//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")
@ryokwkm
ryokwkm / appDelegate.swift
Last active Oct 27, 2015
【swift】iOS 8以上対応 push通知ソース
View appDelegate.swift
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)
@ryokwkm
ryokwkm / CommonWord.cpp
Last active Aug 29, 2015
ひらがなをカタカナへ変換する
View CommonWord.cpp
//文字列を置換する
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() );
}
You can’t perform that action at this time.