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":"5bd875b6975af4cd756467e3","index":0,"guid":"6a7ff4ec-d546-4d94-af09-8e02fc88e92b","isActive":false,"balance":"$3,165.37","picture":"http://placehold.it/32x32","age":34,"eyeColor":"green","name":{"first":"Camille","last":"Guthrie"},"company":"OPTICON","email":"[email protected]","phone":"+1 (943) 512-3372","address":"695 Boardwalk , Toftrees, Florida, 5823","about":"Fugiat sunt cillum exercitation duis magna ad cupidatat veniam. Do excepteur cillum commodo sit nostrud quis. Deserunt sint qui cupidatat mollit voluptate reprehenderit eiusmod labore. Dolor nisi cillum enim consectetur labore. Quis qui voluptate officia est dolor enim eu laborum laboris.","registered":"Sunday, March 18, 2018 2:13 PM","latitude":"-9.76884","longitude":"-105.757728","tags":["consectetur","occaecat","exercitation","aliquip","mollit"],"range":[0,1,2,3,4,5,6,7,8,9],"friends":[{"id":0,"name":"Mejia Donaldson"},{"id":1,"name":"Mercedes Jefferson"},{"id":2,"name":"Wiley Talley"}],"greeting":"Hello, Camille! You have 6 |
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
typedef BOOL(^SCConditionBlock)(UIView *subview); | |
UIView * SCFindSubviewForCondition(UIView *view, SCConditionBlock conditionBlock); | |
UIView * SCFindSubviewForCondition(UIView *view, SCConditionBlock conditionBlock) { | |
NSCParameterAssert(view != nil); | |
if (conditionBlock(view)) { | |
return view; | |
} | |
let subviews = [view subviews]; |
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
awk '/url\(https:\/\/url-path-to-resource-if-needed\/[^)]+.svg\)/{ print $0 }' ../some-style.css | sed 's/.*(\(.*\)).*/\1/p' | sort -u | xargs wget |
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 | |
import XCPlayground | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution = true | |
enum Effects<A> { | |
typealias Action = A | |
case Nothing | |
case EffectTask(Task<Any, Action>) |
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
RACSignal* activitySignal = [[RACObserve(self, viewModel.inProgress) map:^id(NSNumber* value) { | |
if (value.boolValue == NO) return [RACSignal return:@""]; | |
return [[RACSignal interval:0.5 onScheduler:[RACScheduler mainThreadScheduler]] | |
scanWithStart:@"." | |
reduce:^id(NSString* previous, id current) { | |
if (previous.length > 2) return @"."; | |
return [previous stringByAppendingString:@"."]; | |
}]; | |
}] switchToLatest]; |
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 SomeProtocol: class { | |
func pew() -> String | |
} | |
class SomeClass { | |
func someFunc() -> SomeProtocol { | |
let someClosure = { () -> SomeProtocol in | |
class PewPew: SomeProtocol { | |
func pew() -> 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
sudo ls | sed 's/\(.*\)\(\..*\)/mv "\1\2" "\1@2x\2"/p' | sh |
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
// | |
// Mattt's example from NSHipster updated for 8.1 API. (NSHipster article http://nshipster.com/swift-literal-convertible/ ) | |
// Additions for pattern matching for use in switch statements taken from http://lesstroud.com/swift-using-regex-in-switch-statements/ | |
// | |
// ------- | |
// xNekOIx | |
// | |
import Foundation |
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 UIDevice(NKOSVersionCheck) | |
+ (BOOL)nko_isRunningOnIOS7OrLater; | |
@end |
NewerOlder