Skip to content

Instantly share code, notes, and snippets.

View jollyjoester's full-sized avatar

Hideyuki Nanashima jollyjoester

View GitHub Profile
use_frameworks!
target 'RxSwiftSample' do
pod 'RxSwift', '~> 2.0'
pod 'RxCocoa', '~> 2.0'
end
# RxTests and RxBlocking have most sense in the context of unit/integration tests
target 'RxSwiftSampleTest' do
pod 'RxBlocking', '~> 2.0'
@jollyjoester
jollyjoester / HappyBirthDay.swift
Last active January 27, 2016 01:37
実行した日が誕生日だったらHappy Birthdayとprintするだけのスクリプト ref: http://qiita.com/jollyjoester/items/06b2d375e19cff3a8c27
let name = "俺様"
let birthdayComponents = NSDateComponents()
birthdayComponents.year = 1982
birthdayComponents.month = 1
birthdayComponents.day = 18
if let calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian) {
if let birthday = calendar.dateFromComponents(birthdayComponents) {
let now = NSDate()
@jollyjoester
jollyjoester / CodePiece.swift
Created January 21, 2016 02:42
そーいえばSwiftでFizzBuzz #__swift__ #CodePiece
for i in 1...100 {
switch (i % 3, i % 5) {
case (0, 0):
print("FizzBuzz")
case (0, _):
print("Fizz")
case (_, 0):
print("Buzz")
default:
print(i)
@jollyjoester
jollyjoester / CodePiece.swift
Created December 20, 2015 08:11
Singleton #__swift__ #CodePiece
class Singletone {
static let sharedInstance: Singletone = Singletone()
private init() {
print("Singleton")
}
}
@jollyjoester
jollyjoester / TheThreeLittlePigs.txt
Created October 18, 2015 07:07
平成27年度保育士試験実技 言語表現に関する技術 3匹の子ぶた原稿 約3分
3びきの子ぶた。
あるところになかよしの三匹の子ぶたの兄弟がいました。
ある日、お母さんぶたは言いました。
「あなたたちももう大きくなったから、自分で家をたててくらしなさい。」
お母さんぶたに言われて、子ぶたたちは考えます。
「どんな家をつくろうかな…。」
一番上の子ぶたは言いました。
「ぼくはわらの家を作るよ。だってかんたんだもん!」
@jollyjoester
jollyjoester / playground_trial.swift
Last active August 29, 2015 14:05
playground_trial
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
/** constant & value **/
let const = 10
//const = 15 //error
var value = 20
@jollyjoester
jollyjoester / exceptionHandler.m
Created August 22, 2014 00:54
ExceptionHandler
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
〜 途中省略 〜
// エラー追跡用の機能を追加する。
NSSetUncaughtExceptionHandler(&exceptionHandler);
return YES;
}
update
tap homebrew/binary
tap phinze/homebrew-cask
install sl
install tree
install git
install nginx
install node
@jollyjoester
jollyjoester / cocos2dx.sh
Last active August 29, 2015 14:04
Cocos2dxプロジェクト作成メモ
#cocos2dx 2.2.2 プロジェクト作成
/Users/jollyjoester_pro/Documents/cocos2d-x/cocos2d-x-2.2.2/tools/project-creator/create_project.py -project SampleApp -package com.jollyjoester.hogehoge -language cpp
#cocos2dx 3.2 プロジェクト作成
/Users/jollyjoester_pro/Documents/cocos2d-x/cocos2d-x-3.2/tools/cocos2d-console/bin/cocos new SampleApp -p com.jollyjoester.hogehoge -l cpp -d ~/Desktop
@jollyjoester
jollyjoester / VBoxManage.sh
Created July 16, 2014 05:49
Connect docker from MacOSX
#DockerVMにポートフォワーディング(DockerVMのport:80にlocalhost:8080でアクセス)
VBoxManage controlvm "boot2docker-vm" natpf1 "hogehoge,tcp,127.0.0.1,8080,,80"
#ポートフォワーディング確認
VBoxManage showvminfo boot2docker-vm | grep '^NIC'
#ポートフォワーディング削除
VBoxManage controlvm "boot2docker-vm" natpf1 delete hogehoge