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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
@url = "http://www.superakcijas.lv/public/" | |
@deals = "more_deals.php" | |
@response = '' | |
@search_string = 'iPhone' |
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
SpecBegin(UIImageViewAFNetworking) | |
describe(@"Category on UIImageView", ^{ | |
__block UIImageView *imageView; | |
beforeEach(^{ | |
imageView = [[UIImageView alloc] init]; | |
}); | |
it(@"should return default serializer", ^{ |
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 XCTest (Async) | |
+ (NSTimeInterval)waitTillReady:(BOOL (^)())isReady orTimeout:(NSTimeInterval)seconds | |
{ | |
NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate]; | |
NSDate *loopUntil = [NSDate dateWithTimeIntervalSinceNow:seconds]; | |
while (!isReady() && [loopUntil timeIntervalSinceNow] > 0) { | |
[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:loopUntil]; | |
} |
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 NSString (Emoji) | |
- (BOOL)isContainingEmoji | |
{ | |
__block BOOL returnValue = NO; | |
[self enumerateSubstringsInRange:NSMakeRange(0, [self length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock: | |
^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { | |
const unichar hs = [substring characterAtIndex:0]; | |
/* | |
* Surrogate pair. All surrogates are removed because they can cause problems on the server. |