This file contains 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
Start Ups/Business: | |
Thinking, Fast and Slow by Daniel Kahneman | |
The Four Steps to the Epiphany by Steve Blank | |
The Art of the Start: The Time-Tested, Battle-Hardened Guide for Anyone Starting Anything by Guy Kawasaki | |
Founders at Work: Stories of Startups' Early Days by Jessica Livingston | |
The Lean Startup: How Today's Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses by Eric Ries | |
Rework by 37signals | |
The E-Myth Revisited: Why Most Small Businesses Don't Work and What to Do About It by Michael Gerber | |
The Black Swan: Second Edition: The Impact of the Highly Improbable: With a new section: "On Robustness and Fragility" (Incerto) by Nassim Nicholas Taleb | |
Delivering Happiness: A Path to Profits, Passion, and Purpose by Tony Hsieh |
This file contains 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
let userInfo = reloadTrigger | |
.flatMapLatest { [apiService, selectedUser] in | |
apiService.fetchUserInfo(with: selectedUser.id) | |
.trackActivity(activityIndicator) | |
} | |
.share(replay: 1) | |
let favorites = userInfo | |
.flatMapLatest { [apiService] in | |
apiService.fetchFavorites(with: $0.id) | |
.trackActivity(activityIndicator) |
This file contains 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
let onUnit = BehaviorRelay(value: "") | |
let onTotal = BehaviorRelay(value: "") | |
let onPriceUpdated = BehaviorRelay<ProductPriceEntity?>(value: nil) | |
let onQuantity = BehaviorRelay(value: 1) | |
var prices: [ProductPriceEntity] = [] | |
Observable.combineLatest(onUnit, onQuantity).flatMapLatest{[weak self] (unit, qty) -> Observable<Void> in | |
guard let self = self else { return Observable.just(()) } | |
let price = self.unitPrices.value[unit]?.filter { price in |
This file contains 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
import UIKit | |
import RxSwift | |
import RxCocoa | |
import RxDataSources | |
private let reuseIdentifier = "OrderProductItemCell" | |
class OrderProductItemView: UICollectionViewController { | |
var viewModel: | |
OrderProductsViewModel! |
This file contains 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
let headerRefreshTrigger = PublishSubject<Void>() | |
let retryRefreshTrigger = PublishSubject<Void>() | |
let refresh = Observable.of(Observable.just(()), headerRefreshTrigger, retryRefreshTrigger.mapToVoid()).merge() | |
let input = ViewModel.Input(headerRefresh: refresh) | |
//triggered when retry button tapped | |
xbutton?.rx.tap.asDriver().drive(onNext: { [weak self] (_) in | |
self?.retryRefreshTrigger.onNext(()) | |
}).disposed(by: rx.disposeBag) |
This file contains 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
` version: 2 | |
jobs: | |
build-and-test: | |
macos: | |
xcode: "10.0.0" | |
working_directory: /Users/distiller/project | |
environment: | |
LC_ALL: en_US.UTF-8 | |
LANG: en_US.UTF-8 | |
FL_OUTPUT_DIR: output |
This file contains 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
import UIKit | |
import RxSwift | |
import RxCocoa | |
import RxDataSources | |
private let reuseIdentifier = "ProductImageItemCell" | |
protocol ProductHeaderCarouselDelegate { | |
func didTapItem(indexPath: IndexPath, selectedImage: ImageView) | |
} |
This file contains 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
/ Create flow layout | |
let flow = UICollectionViewFlowLayout() | |
// Define layout constants | |
let itemSpacing: CGFloat = 1 | |
let minimumCellWidth: CGFloat = 120 | |
let collectionViewWidth = collectionView!.bounds.size.width | |
// Calculate other required constants | |
let itemsInOneLine = CGFloat(Int((collectionViewWidth - CGFloat(Int(collectionViewWidth / minimumCellWidth) - 1) * itemSpacing) / minimumCellWidth)) |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:fitsSystemWindows="true" | |
> |
This file contains 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
fun generateHashkey() { | |
try { | |
if (Build.VERSION.SDK_INT >= 28) { | |
@SuppressLint("WrongConstant") val packageInfo = getPackageManager().getPackageInfo( | |
getPAckageName(), PackageManager.GET_SIGNING_CERTIFICATES | |
) | |
val signatures = packageInfo.signingInfo.getApkContentsSigners() | |
val md = MessageDigest.getInstance("SHA") | |
for (signature in signatures) { |
NewerOlder