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 | |
/* | |
* If You want to prohibit that guest users display it, | |
* write in this group. | |
*/ | |
Route::group(array('before' => 'auth'), function() | |
{ | |
Route::get('/', array( | |
'uses' => 'MainController@index', |
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 "em-websocket" | |
require 'json' | |
require 'sinatra/base' | |
require 'thin' | |
$stdout.sync = true | |
# FIX_ME: port とか host とか直打ちしない | |
EventMachine.run { | |
@globalChannel = EM::Channel.new |
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
// id obj = custom[@1]; | |
- (id)objectForKeyedSubscript:(id)key; | |
// custom[@1] = @0; | |
- (void)setObject:(id)anObject forKeyedSubscript:(id <NSCopying>)aKey; |
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
playground -> "パッケージの内容を表示" -> Resources ディレクトリ作成 |
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
import XCPlayground |
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
/* | |
* 下記サイトの問題を題材にさせていただきました | |
* is AnyObject?: http://qiita.com/taketo1024/items/21d8c5fb81ab388ccdb6 | |
*/ | |
import Foundation | |
() is AnyObject | |
1 is AnyObject | |
(1, 2) is AnyObject |
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
struct SampleStruct {} | |
extension SampleStruct : SequenceType { | |
typealias Generator = SampleGenerator | |
func generate() -> Generator { | |
return Generator() | |
} | |
} | |
struct SampleGenerator : GeneratorType { |
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
// 詳しい解説は下記 | |
// https://trifort.jp/blog/development/%E6%8E%A2%E6%A4%9C%EF%BC%81swiftyjson-%E5%89%8D%E7%B7%A8/ | |
struct SampleStruct { | |
var object:Any? | |
} | |
// ここに実装を追加していきます | |
// [] を実装 | |
extension SampleStruct { |
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
class DescriptionSample: Printable, DebugPrintable { | |
var m = "sample" | |
// Printable | |
var description: String { | |
return "\(m) description" | |
} | |
// DebugPrintable | |
var debugDescription: String { | |
return "\(m) debugDescription" | |
} |
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
protocol A { | |
func protocolAFunc (); | |
} | |
protocol B { | |
func protocolBFunc (); | |
} | |
struct Sample { | |
func protocolAFunc() { |
OlderNewer