Skip to content

Instantly share code, notes, and snippets.

View yas375's full-sized avatar

Victor Ilyukevich yas375

  • Walmart Global Tech
  • Seattle, WA
  • 04:07 (UTC -07:00)
View GitHub Profile
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.
@yas375
yas375 / gist:f9e44d7761859e0dc7e4
Created December 4, 2014 08:32
Decimal separators in different locales
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;
@yas375
yas375 / gist:10354859
Created April 10, 2014 08:12
Stub current date and test date calculations which use `NSDate#timeIntervalSinceNow` internally
#import <objc/runtime.h>
@implementation NSDate (CZTesting)
- (NSTimeInterval)cz_timeIntervalSinceNow
{
return (self.timeIntervalSince1970 - [NSDate date].timeIntervalSince1970);
}
@end
@yas375
yas375 / README.md
Last active January 1, 2016 10:29
A helper function to stub network requests
@yas375
yas375 / WGTitleViewSpec.m
Last active December 30, 2015 08:19 — forked from delebedev/test
#import <Kiwi/Kiwi.h>
#import "WGTitleView.h"
@interface WGTitleView ()
@property (strong, nonatomic) UILabel *titleLabel;
@property (strong, nonatomic) UILabel *subtitleLabel;
- (void)onTap:(id)sender;
@yas375
yas375 / Podfile
Last active December 25, 2015 21:19
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
@yas375
yas375 / README.md
Last active December 18, 2015 11:09

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:

  1. run mitmproxy on your computer which is in the same network with your ios device.
  2. on your ios device in wifi preferences set to use your computer as proxy (you need to provide your computer's ip address in local network, and port. 8080 is a default port for mitmproxy)
  3. run the app on ios app
  4. grub the url to .../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" | \
@yas375
yas375 / DebugHelpers.h
Created November 23, 2012 15:19
Measuring the execution time of some code
#include <mach/mach_time.h>
void RecordPerformanceMetricks(uint64_t start, uint64_t end);
@yas375
yas375 / OperationsController.h
Created August 23, 2012 08:39
Handle a few operations per one view controller
@interface OperationsController : NSObject
- (void)addOperation:(MKNetworkOperation *)operation;
- (void)cancelAllOperations;
@end