Step1: Remove Parallels with AppCleaner (https://freemacsoft.net/appcleaner/)
Step2: Run reset.sh file
Step3: Install Parallels
public class RxSearchObservable { | |
public static Observable<String> fromView(SearchView searchView) { | |
final PublishSubject<String> subject = PublishSubject.create(); | |
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { | |
@Override | |
public boolean onQueryTextSubmit(String s) { | |
subject.onComplete(); |
Step1: Remove Parallels with AppCleaner (https://freemacsoft.net/appcleaner/)
Step2: Run reset.sh file
Step3: Install Parallels
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj | |
Cloning into 'my-awesome-proj'... | |
ssh: connect to host github.com port 22: Connection timed out | |
fatal: Could not read from remote repository. | |
$ # This should also timeout | |
$ ssh -T git@github.com | |
ssh: connect to host github.com port 22: Connection timed out | |
$ # but this might work |
fun isVietnamesePhoneNumber(): Boolean { | |
phoneNumber.value?.let { | |
val pattern = "(03|07|08|09|01[2|6|8|9])+([0-9]{8})\\b".toRegex() | |
return pattern.matches(it) | |
} | |
return false | |
} |
package com.gunaya.demo.demomeow.presentation.base | |
import androidx.lifecycle.MediatorLiveData | |
import androidx.lifecycle.MutableLiveData | |
import androidx.lifecycle.ViewModel | |
import com.gunaya.demo.demomeow.utils.EventWrapper | |
import com.gunaya.demo.demomeow.utils.SingleLiveEvent | |
import com.gunaya.demo.demomeow.utils.UseCaseResult | |
import kotlinx.coroutines.* | |
import kotlin.coroutines.CoroutineContext |
fun <T> debounce( | |
waitMs: Long = 300L, | |
scope: CoroutineScope, | |
destinationFunction: (T) -> Unit | |
): (T) -> Unit { | |
var debounceJob: Job? = null | |
return { param: T -> | |
debounceJob?.cancel() | |
debounceJob = scope.launch { | |
delay(waitMs) |
import android.content.Context | |
import android.content.SharedPreferences | |
import kotlin.reflect.KProperty | |
/** | |
* Represents a single [SharedPreferences] file. | |
* | |
* Usage: | |
* | |
* ```kotlin |
package com.thunderclouddev.changelogs.ui | |
import android.content.Context | |
import android.os.Bundle | |
import android.support.annotation.LayoutRes | |
import android.support.annotation.StyleRes | |
import android.support.v7.app.AppCompatActivity | |
import com.thunderclouddev.changelogs.BaseApplication | |
import com.thunderclouddev.changelogs.R | |
import com.thunderclouddev.changelogs.configuration.LanguagePreference |