Skip to content

Instantly share code, notes, and snippets.


Adam Borek TheAdamBorek

View GitHub Profile
TheAdamBorek /
Last active Jun 1, 2016
pre_push git hook which invokes synx script before every push


To install this hook you have to create a pre_push file inside .git/hooks/ and paste there the script written below. Next you have to set execute permisions with following command:

$ chmod a+x pre_push

Don't forget to change the project name inside the script.

TheAdamBorek / PostsListViewModel.swift
Last active Aug 21, 2016
Inject an generic struct
View PostsListViewModel.swift
// Created by Adam Borek on 17.06.2016.
import Foundation
import RxSwift
import RxCocoa
class PostsListViewModel {
typealias Index = Int
View RxActionSheet.swift
private var selectedOption: Observable<ImageSource> {
return Observable.create { [weak self] observer in
guard let `self` = self else {
return Disposables.create()
let actionSheet = self.prepareActionSheet(with: observer)
return Disposables.create {
View ab_rxactionsheet_tests_2.swift
final class ViewModelTests: XCTestCase {
private var subject: AvatarViewModel!
var imageHavingMock: ImageHavingStub!
override func setUp() {
rx_disposeBag = DisposeBag()
imageHavingMock = ImageHavingStub()
subject = AvatarViewModel(imageReceiver: imageHavingMock)
View ab_rxactionsheet_tests_4.swift
let buttonTap = PublishSubject<Void>()
.disposed(by: rx_disposeBag)
View ab_rxactionsheet_tests_6.swift
XCTAssertEqual(resultImage, imageHavingMock.expectedImage)
View ab_rxactionsheet_tests_7.swift
func test_receiveImage_onButtonClick() {
var resultImage: UIImage! { image in
resultImage = image
}).disposed(by: rx_disposeBag)
XCTAssertEqual(resultImage, imageHavingMock.expectedImage)
View ab_rxactionsheet_tests_5.swift
var resultImage: UIImage! { image in
resultImage = image
}).disposed(by: rx_disposeBag)
View ab_rxactionsheet_tests_8.swift
func test_receiveImage_onButtonClick_version2() {
let testScheduler = TestScheduler(initialClock: 0)
You can’t perform that action at this time.