I hereby claim:
- I am shaps80 on github.
- I am shaps (https://keybase.io/shaps) on keybase.
- I have a public key whose fingerprint is D1B3 44E7 F8A9 EF64 D1E0 4292 4286 651A F5BD CB47
To claim this, I am signing this object:
| /* | |
| Copyright (c) 2014 Shaps Mohsenin. All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| 1. Redistributions of source code must retain the above copyright notice, this | |
| list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright notice, |
| typedef NS_ENUM(NSInteger, kErrorCode) { | |
| kErrorCodeInternal = 431432, | |
| }; | |
| extern NSError *NSErrorMake(NSString *message, NSInteger code, NSDictionary *aUserInfo, NSString *methodOrFunction); | |
| #define NSObjcAssert NSAssert | |
| #define InvalidConditionString(condition) (@"Invalid condition not satisfying: " #condition) | |
| #define GenericAssertCondition(ctype, condition) NS ## ctype ## Assert((condition), InvalidConditionString((condition))) | |
| #define GenericErrorMake(condition, func) NSErrorMake(InvalidConditionString((condition)), kErrorCodeInternal, nil, func) |
| #!/usr/bin/env bash | |
| function openWorkspaceOrProjectWithApp() | |
| { | |
| if [[ -z "$1" || "$#" -ne 2 ]]; then | |
| echo -e "Nothing found\n" | |
| return | |
| fi | |
| IDEFileName=${2##*/} |
I hereby claim:
To claim this, I am signing this object:
| @interface UIView (SPXAdditions) | |
| + (void)animate:(BOOL)shouldAnimate duration:(CGFloat)duration animations:(void (^)(void))animations; | |
| + (void)animate:(BOOL)shouldAnimate duration:(CGFloat)duration animations:(void (^)(void))animations completion:(void (^)(BOOL finished))completion; | |
| + (void)animate:(BOOL)shouldAnimate duration:(CGFloat)duration delay:(CGFloat)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL))completion; | |
| + (void)animate:(BOOL)shouldAnimate duration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL))completion; | |
| + (void)transition:(BOOL)shouldTransition fromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL))completion; | |
| + (void)transition:(BOOL)shoul |
| it (@"should eventually throw assert for asynchronous operation", ^{ | |
| [[theBlock(^{ | |
| [MyClass performLongRunningAsynchronousTasks]; | |
| }) shouldEventually] raise]; | |
| }); |
| @import Foundation; | |
| @interface UIApplication (SnippexAdditions) | |
| + (BOOL)isAppExtension; | |
| @end |
| // | |
| // UIView+NibLoading.swift | |
| // Sam Dods on 29/10/2015. | |
| // | |
| import UIKit | |
| /// Protocol to be extended with implementations | |
| protocol UIViewLoading {} |
| import Foundation | |
| /** | |
| * Simple GCD Wrapper | |
| */ | |
| public struct Queue { | |
| public typealias TimeInterval = NSTimeInterval | |
| public static let Main = Queue(queue: dispatch_get_main_queue()); |
| func enumIterator<T: Hashable>(_: T.Type) -> AnyGenerator<T> { | |
| var cast: (Int -> T)! | |
| switch sizeof(T) { | |
| case 0: return anyGenerator(GeneratorOfOne(unsafeBitCast((), T.self))) | |
| case 1: cast = { unsafeBitCast(UInt8(truncatingBitPattern: $0), T.self) } | |
| case 2: cast = { unsafeBitCast(UInt16(truncatingBitPattern: $0), T.self) } | |
| case 4: cast = { unsafeBitCast(UInt32(truncatingBitPattern: $0), T.self) } | |
| case 8: cast = { unsafeBitCast(UInt64($0), T.self) } | |
| default: fatalError("cannot be here") | |
| } |