休日 | 期日 | 適用開始年 | 適用終了年 |
---|---|---|---|
元日 | 1月1日 | 1948年7月20日 | - |
元始祭 | 1月3日 | 1873年10月14日 | 1948年7月20日 |
新年宴会 | 1月5日 | 1873年10月14日 | 1948年7月20日 |
成人の日 | 1月15日 | 1948年7月20日 | 2000年1月1日 |
成人の日 | 1月の第2月曜日 | 2000年1月1日 | - |
孝明天皇祭 | 1月30日 | 1873年10月14日 | 1912年 |
紀元節 | 2月11日 | 1873年10月14日 | 1948年7月20日 |
This file contains hidden or 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 "NSObject+performSelector.h" | |
@implementation NSObject (performSelector) | |
- (void)call:(NSString *)sel { | |
[self performSelector:@selector(sel)]; | |
} | |
- (id)get:(NSString *)sel { | |
return [self performSelector:@selector(sel)]; |
This file contains hidden or 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
// 鳥とバランス棒のシノニムを定義 | |
typealias Birds = Int | |
typealias Pole = (left: Birds, right: Birds) | |
// 左右に鳥が飛んできたことを表現 | |
func landLeft(n: Birds) -> Pole -> Pole { | |
return {p in (p.left + n, p.right)}; | |
} | |
func landRight(n: Birds) -> Pole -> Pole { |
This file contains hidden or 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 Dictionary { | |
func map<K, V>(f: (Key, Value) -> (K, V)) -> [K: V] { | |
var r = Dictionary<K, V>(minimumCapacity: self.count) | |
for key in self.keys { | |
let (k, d) = f(key, self[key]!) | |
r[k] = d | |
} | |
return r | |
} | |
} |
This file contains hidden or 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 UIKit | |
protocol UIViewControllerProtocol { | |
// hogehoge... | |
} | |
extension UIViewController: UIViewControllerProtocol { | |
} | |
var viewController: protocol<UIViewControllerProtocol, UITableViewDelegate>! = nil |
This file contains hidden or 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
Pod::Spec.new do |s| | |
s.name = "AMoAd" | |
s.version = "3.9.7" | |
s.summary = "AMoAdネイティブ広告(SDK for iOS)" | |
s.homepage = "https://github.com/amoad/amoad-ios-sdk" | |
s.ios.deployment_target = '7.0' | |
s.license = { :type => 'o', :file => 'LICENSE' } | |
s.author = { "amoad" => "[email protected]" } | |
s.source = { | |
:tag => "v3.9.7", |
This file contains hidden or 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
let array = [1, 2, 3, 4, 5] | |
for num in array.reverse() { | |
print("num: \(num)"); | |
} | |
for (index, num) in array.enumerate().reverse() { | |
print("num: \(num)"); | |
print("inde: \(index)\n"); | |
} |
This file contains hidden or 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 MyStruct<T: Equatable>: Equatable { | |
let x: T; | |
} | |
func ==<T>(x: MyStruct<T>, y: MyStruct<T>) -> Bool { | |
return x.x == y.x | |
} | |
let s1 = MyStruct(x: 1) | |
let s2 = MyStruct(x: 2) |
This file contains hidden or 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 XCTest | |
class HeiseiTests: XCTestCase { | |
func test平成じゃない() { | |
let calendar = Calendar(identifier: .japanese) | |
let component = DateComponents( | |
calendar: calendar, | |
timeZone: nil, | |
era: 235, // 平成 | |
year: 31, |
This file contains hidden or 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 Foundation | |
Date.timeIntervalSinceReferenceDate | |
Date.timeIntervalBetween1970AndReferenceDate | |
Date().timeIntervalSince1970 | |
Date().timeIntervalSinceReferenceDate | |
Date().addingTimeInterval(-Date().timeIntervalSinceReferenceDate) | |
978307200 / 60 / 60 / 24 / 365 | |
print(String(554378506, radix: 2)) |