Skip to content

Instantly share code, notes, and snippets.

View yas375's full-sized avatar

Victor Ilyukevich yas375

  • Walmart Global Tech
  • Seattle, WA
  • 15:11 (UTC -07:00)
View GitHub Profile
@yas375
yas375 / MBProgressHUD+Additions.h
Created May 11, 2016 18:30
Migrating from SVProgressHUD to MBProgressHUD. We needed to expose `hasFinished` from MBProgressHUD's implementation and have added tests to make sure we remember about it when we upgrade MBProgressHUD. We didn't use Swift's default values and instead have added multiple `showStatus...` because we need to use it from Objective-C.
//
// MBProgressHUD+Additions.h
// Caremobile
//
// Created by Victor Ilyukevich on 4/13/16.
// Copyright © 2016 Care Zone Inc. All rights reserved.
//
@interface MBProgressHUD (Additions)
- (BOOL)hasFinished;
@yas375
yas375 / devices.txt
Created January 20, 2016 19:28
`ruby fix_names.rb > nice.csv`
iPhone1,1 iPhone
iPhone1,2 iPhone 3G
iPhone2,1 iPhone 3GS
iPhone3,1 iPhone 4 (GSM)
iPhone3,3 iPhone 4 (CDMA)
iPhone4,1 iPhone 4S
iPhone5,1 iPhone 5 (A1428)
iPhone5,2 iPhone 5 (A1429)
iPhone5,3 iPhone 5c (A1456/A1532)
iPhone5,4 iPhone 5c (A1507/A1516/A1529)
@yas375
yas375 / justplay
Last active June 7, 2016 22:29
Annoyed by Xcode asking a name for each playground you create? Me too! Most often I use playgrounds I just want to try out something real quick.
#!/bin/bash
set -e
TEMPLATE_NAME="Template.playground"
DESTINATION_PATH=`mktemp -d`/$TEMPLATE_NAME
cp -R "`dirname $0`/$TEMPLATE_NAME" $DESTINATION_PATH
open $DESTINATION_PATH
@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 / expected_output
Last active May 10, 2016 03:05
Why `double` is called 5 times and `filter` is called 4 times? Shouldn't they be called same amount of times? Shouldn't they both be called only twice as I have 2-element array?
double 2
filter 4
double 8
filter 16
result: [4]
func double(value: Int) -> Int {
print("double \(value)")
return value * 2
}
func triple(value: Int) -> Int {
print("triple \(value)")
return value * 3
}
func double(value: Int) -> Int {
print("double \(value)")
return value * 2
}
func triple(value: Int) -> Int {
print("triple \(value)")
return value * 3
}
@yas375
yas375 / readme.md
Last active April 12, 2016 05:30
How to do rebase on a branch which has been force pushed

How to do rebase on a branch which has been force pushed

Looking into your branch:

98a21db Lorem (5 days ago)
3e3fc13 Ipsum
f73a5bb Dolor - This was the latest commit in parent branch when you've started a new one.
a25992b Sit - This is the first commit in your new branch.
42f6c06 Amet (1 hour ago)

Keybase proof

I hereby claim:

  • I am yas375 on github.
  • I am yas375 (https://keybase.io/yas375) on keybase.
  • I have a public key ASC-lX0XY5qQ26UPFzIPiEtZg7_PUBKtSstl9Zg2BUsL3go

To claim this, I am signing this object:

@yas375
yas375 / process.sh
Last active January 21, 2016 22:52
Process `ffmpeg` on all mp4 files in current directory.
#!/bin/sh
mkdir -p processed
for file in *.mp4
do
ffmpeg -i $file -vcodec libx264 -crf 10 -x264opts colorprim=bt709:transfer=bt709:colormatrix=bt709:fullrange=off processed/$file
done