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 <Foundation/Foundation.h> | |
typedef id(^STTemplateBlocks)(); | |
typedef void(^STTemplateBlocksVoid)(); | |
#define STTemplateExecute(instance, aKey, ...) \ | |
((STTemplateBlocks)[instance templateOf:aKey])(__VA_ARGS__) | |
#define STTemplateApply(instance, aKey, ...) \ | |
((STTemplateBlocksVoid)[instance templateOf:aKey])(__VA_ARGS__) |
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
// メッセージを続けて記述可能 | |
// [SafeCast(NSMutableURLRequest, request) setTimeoutInterval:30]; | |
#define SafeCast(type, var) \ | |
^type *(id obj, Class clazz) {\ | |
if ([obj isKindOfClass:clazz]) {\ | |
return obj;\ | |
}\ | |
return nil;\ | |
} (var, [type class]) |
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 var1 = @"hoge"; | |
VARLOG(var1); | |
id var2 = @{@"huga": @"hoge"}; | |
VARLOG(var1, var2); | |
// output | |
// -[AppDelegate application:didFinishLaunchingWithOptions:] at LINE:78 | |
// { | |
// var1 = hoge; |
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 <Foundation/Foundation.h> | |
@interface NSString (NSUserDefaults) | |
@property BOOL defaultsBool; | |
@property NSInteger defaultsInteger; | |
@property float defaultsFloat; | |
@property double defaultsDouble; | |
@property id defaultsObject; | |
@property NSData *defaultsData; | |
@property NSString *defaultsString; |
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
``` | |
pip install rstr | |
pip install jinja2 | |
``` | |
`Python 3.4.1` |
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 UIKit | |
import XCPlayground | |
enum Path: Equatable { | |
case Current | |
case Parent | |
case Root | |
case Letter(String) | |
} |
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 - noun: a place where people can play | |
import UIKit | |
import XCPlayground | |
protocol ObjectProtocol {} | |
protocol QuerySetProtocol { | |
} |
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
// | |
// main.swift | |
// Formula | |
// | |
// Created by 林達也 on 2016/03/20. | |
// Copyright © 2016年 jp.sora0077. All rights reserved. | |
// | |
//: Playground - noun: a place where people can play |
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
//: [Previous](@previous) | |
import Foundation | |
import UIKit | |
import XCPlayground | |
enum ParseError: Swift.Error { | |
case notSatisfy | |
} |
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 UIKit | |
final class HardRubberbandView: UIView, UIScrollViewDelegate { | |
var contentSize: CGSize = .zero { | |
didSet { | |
scrollView.contentSize = contentSize | |
contentView.frame.size = contentSize | |
} | |
} | |
@objc |
OlderNewer