A helper function to stub network requests with OHHTTPStubs using raw response recorded with curl -is.
Inspired by the feature of Nocilla to stub raw responses recorded with curl -is and this gist by Denis Lebedev.
| Steps | |
| 1. Sign up on the web using Facebook. | |
| 2. During Sign up there is an option to edit what info should be available for OpenTable. | |
| 3. The email is optional there. Disable it. | |
| 4. Finish sign up process | |
| Expected: I'm signed in. | |
| Result: an alert saying I've got 500 error. Try to sign in - 500 error again. |
| NSMutableDictionary *knownSeparators = [NSMutableDictionary dictionary]; | |
| [[NSLocale availableLocaleIdentifiers] bk_each:^(NSString *identifier) { | |
| NSLocale *locale = [NSLocale localeWithLocaleIdentifier:identifier]; | |
| NSString *separator = [locale objectForKey:NSLocaleDecimalSeparator]; | |
| NSMutableArray *localeIdentifiers = knownSeparators[separator]; | |
| if (localeIdentifiers == nil) { | |
| localeIdentifiers = [NSMutableArray array]; | |
| knownSeparators[separator] = localeIdentifiers; |
| #import <objc/runtime.h> | |
| @implementation NSDate (CZTesting) | |
| - (NSTimeInterval)cz_timeIntervalSinceNow | |
| { | |
| return (self.timeIntervalSince1970 - [NSDate date].timeIntervalSince1970); | |
| } | |
| @end |
A helper function to stub network requests with OHHTTPStubs using raw response recorded with curl -is.
Inspired by the feature of Nocilla to stub raw responses recorded with curl -is and this gist by Denis Lebedev.
| #import <Kiwi/Kiwi.h> | |
| #import "WGTitleView.h" | |
| @interface WGTitleView () | |
| @property (strong, nonatomic) UILabel *titleLabel; | |
| @property (strong, nonatomic) UILabel *subtitleLabel; | |
| - (void)onTap:(id)sender; |
| post_install do |installer_representation| | |
| installer_representation.project.targets.each do |target| | |
| if target.name == 'Pods-MTDates' | |
| target.build_configurations.each do |config| | |
| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)'] | |
| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << 'MTDATES_NO_PREFIX=1' | |
| end | |
| end | |
| end | |
| end |
In continuation of discussion started here there is a script, which allows to download videos. It will download and store them in the same directory as script is. If file is already exist - it would be downloaded again. As a result: you can run a few instances of script and they will download and store a few videos in parallel.
To get it all working you need the url with all the sessions links. I've grubbed it from the iOS app using mitmproxy:
.../videos.json and put in the script.Put the downloader.rb to directory where you want to store the videos and run ruby downloader.rb.
| #!/bin/sh | |
| REPO="$1" | |
| OUTFILE="$2" | |
| gource -1280x720 -s 0.2 -i 20 -a 1 --stop-at-end \ | |
| --user-image-dir .git/avatar/ \ | |
| --output-ppm-stream - --output-framerate 25 \ | |
| --multi-sampling \ | |
| --highlight-all-users "$REPO" | \ |
| #include <mach/mach_time.h> | |
| void RecordPerformanceMetricks(uint64_t start, uint64_t end); |
| @interface OperationsController : NSObject | |
| - (void)addOperation:(MKNetworkOperation *)operation; | |
| - (void)cancelAllOperations; | |
| @end |