Over 10'000'000
app downloads on the App Store.
Drop me a line at rbaulin@gmail.com
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
// | |
// KeychainBehaviourTests.m | |
// | |
// Created by Roman Baulin on 25/04/2017. | |
// Copyright © 2017. All rights reserved. | |
// | |
// | |
// see SecBase.h and osstatus.com and to investigate keychain error codes | |
// |
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
/* | |
File: UIImage+ImageEffects.h | |
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. | |
Version: 1.0 | |
Copyright (C) 2013 Apple Inc. All Rights Reserved. | |
*/ | |
@import UIKit; |
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
@implementation NSArray (FDMapping) | |
// import, array diff | |
// https://github.com/glebd/google-toolbox-for-mac/blob/master/Foundation/GTMNSArray%2BMerge.m | |
// https://github.com/Wondermall/Doppelganger | |
// https://github.com/Basket/BKDeltaCalculator/blob/master/BKDeltaCalculator/BKDeltaCalculator.m | |
+ (void)ag_mapSourceArray:(NSArray *)source toDestArray:(NSArray *)dest sourceKey:(id (^)(id obj))sourceKeyBlock destKey:(id (^)(id obj))destKeyBlock compare:(NSComparisonResult (^)(id, id))compareBlock match:(void (^)(id, id))matchBlock { | |
NSArray *sortedSource = [source sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { |
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
NSString *rand_str() { | |
NSString *alphabet = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXZY0123456789"; | |
u_int32_t len = arc4random_uniform(20) + 5; | |
NSMutableString *s = [NSMutableString stringWithCapacity:len]; | |
for (NSUInteger i = 0U; i < len; i++) { | |
u_int32_t r = arc4random() % [alphabet length]; | |
unichar c = [alphabet characterAtIndex:r]; | |
[s appendFormat:@"%C", c]; | |
} | |
return s; |
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
// Created by Roman Baulin on 17.05.2012 | |
#target photoshop | |
// in case we double clicked the file | |
app.bringToFront(); | |
var doc = app.activeDocument; | |
var startState = doc.activeHistoryState; // save for undo | |
var initialPrefs = app.preferences.rulerUnits; // will restore at end |
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
- (instancetype)init | |
{ | |
self = [super initWithStyle:UITableViewStyleGrouped]; | |
if (self) { | |
} | |
return self; | |
} | |
- (void)viewDidLoad { | |
[super viewDidLoad]; |
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
#define IS_7_0 (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) | |
#define IS_PAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) | |
#define IS_PHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) | |
#define IS_IPHONE_5 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f) | |
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] | |
#ifdef DEBUG | |
# define LOG_MESSAGE(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__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
self.currentItem = item; | |
RACSignal *itemChanged = [[RACObserve(self, currentItem) skip:1] take:1]; | |
// prepare item until switched to other item | |
RACSignal *itemReady = [[item rac_prepareItem] takeUntil:itemChanged]; | |
// show description if preparation takes more than 1 second | |
[[[[[RACSignal interval:1.] take:1] | |
takeUntil:itemReady] | |
deliverOn:[RACScheduler mainThreadScheduler]] |
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
@interface MultilineLabel : UILabel | |
@property (nonatomic) CGFloat maximumWidth; | |
@end | |
@implementation MultilineLabel | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
_maximumWidth = 200; |
NewerOlder