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
#!/bin/bash | |
set -x | |
set -e | |
# Pass scheme name as the first argument to the script | |
NAME=$1 | |
# Rewrite Package.swift so that it declaras dynamic libraries, since the approach does not work with static libraries | |
perl -i -p0e 's/type: .static,//g' Package.swift |
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
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]]; | |
NSArray *fontNames; | |
NSInteger indFamily, indFont; | |
for (indFamily=0; indFamily<[familyNames count]; ++indFamily) | |
{ | |
NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]); | |
fontNames = [[NSArray alloc] initWithArray: | |
[UIFont fontNamesForFamilyName: | |
[familyNames objectAtIndex:indFamily]]]; | |
for (indFont=0; indFont<[fontNames count]; ++indFont) |
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
@weakify(self); | |
[[[[[[NSNotificationCenter defaultCenter] rac_addObserverForName:@"NotificationKey" | |
object:nil] takeUntil:self.rac_willDeallocSignal] filter:^BOOL(NSNotification *notification) { | |
/* | |
Validate something for filter | |
@strongify(self); | |
NSDictionary *userInfo = notification.userInfo; | |
return [self.followersViewModel.itemId isEqualToNumber:userInfo[@"itemId"]]; | |
*/ | |
}] deliverOnMainThread] subscribeNext:^(NSNotification *notification) { |
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
#!/bin/bash | |
mkdir /tmp/curl-ca-bundle | |
cd /tmp/curl-ca-bundle | |
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2 | |
tar xzf curl-7.22.0.tar.bz2 | |
cd curl-7.22.0/lib/ | |
./mk-ca-bundle.pl | |
if [ ! -d /usr/share/curl/ ]; then | |
sudo mkdir -p /usr/share/curl/ | |
else |
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
@interface NSData(Hex) | |
-(NSString*)hexRepresentationWithSpaces_AS:(BOOL)spaces; | |
@end |
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
@implementation NSData(Hex) | |
-(NSString*)hexRepresentationWithSpaces_AS:(BOOL)spaces | |
{ | |
const unsigned char* bytes = (const unsigned char*)[self bytes]; | |
NSUInteger nbBytes = [self length]; | |
//If spaces is true, insert a space every this many input bytes (twice this many output characters). | |
static const NSUInteger spaceEveryThisManyBytes = 4UL; | |
//If spaces is true, insert a line-break instead of a space every this many spaces. | |
static const NSUInteger lineBreakEveryThisManySpaces = 4UL; | |
const NSUInteger lineBreakEveryThisManyBytes = spaceEveryThisManyBytes * lineBreakEveryThisManySpaces; |
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
- (BOOL)respondsToSelector:(SEL)aSelector | |
{ | |
static BOOL useSelector; | |
static dispatch_once_t predicate = 0; | |
dispatch_once(&predicate, ^{ | |
useSelector = SYSTEM_VERSION_LESS_THAN(@"8.0"); | |
}); | |
if (aSelector == @selector(tableView:heightForRowAtIndexPath:)) | |
{ |
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
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) | |
{ | |
[self.tableView setRowHeight:UITableViewAutomaticDimension]; | |
[self.tableView setEstimatedRowHeight:50]; | |
} |
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
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) | |
{ | |
[self p_configureView]; | |
[self p_configureConstraints]; | |
} | |
return self; |
NewerOlder