Skip to content

Instantly share code, notes, and snippets.

View vchernyshov's full-sized avatar

Volodymyr Chernyshov vchernyshov

View GitHub Profile
Execution platform: @local_config_platform//:host
ld: warning: Could not find or use auto-linked framework 'FBLPromises'
Undefined symbols for architecture x86_64:
"_GRPC_SHADOW_ASN1_STRING_to_UTF8", referenced from:
peer_from_x509(x509_st*, int, tsi_peer*) in gRPC-Core(ssl_transport_security.o)
"_GRPC_SHADOW_BIO_free", referenced from:
grpc_auth_json_key_create_from_json(grpc_core::Json const&) in gRPC-Core(json_token.o)
tsi_ssl_extract_x509_subject_names_from_pem_cert(char const*, tsi_peer*) in gRPC-Core(ssl_transport_security.o)
peer_from_x509(x509_st*, int, tsi_peer*) in gRPC-Core(ssl_transport_security.o)
x509_store_load_certs(x509_store_st*, char const*, unsigned long, stack_st_X509_NAME**) in gRPC-Core(ssl_transport_security.o)
@vchernyshov
vchernyshov / BUILD
Created March 2, 2021 10:46
Telegram Firebase
load("@//Infra/Pods:apple_xcframework_import.bzl", "apple_static_xcframework_import")
apple_static_xcframework_import(
name = "GoogleMobileAds",
path = "Google-Mobile-Ads-SDK/GoogleMobileAds.xcframework",
development_prefix = "ios-arm64_x86_64-simulator/GoogleMobileAds.framework",
release_prefix = "ios-arm64_armv7/GoogleMobileAds.framework"
)
How logs were collected:
private val codeFilled = code.text.observable
.doOnNext { println("Confirm: text emitted") }
.filter { it.length == CODE_LENGTH }
.doOnNext { println("Confirm: filtered") }
.distinctUntilChanged()
.doOnNext { println("Confirm: distinct") }
.map { Unit }
@class MPLRpmPresentationModel, MPLRpmAction<T>, MPLRpmCommand<T>, MPLRpmState<T>, MPLRpmPresentationModelLifecycle, MPLPhoneUtil, MPLRpmInputControl, MPLRpmCheckControl, MPLKotlinUnit, MPLNotification, MPLAppNavigationMessage, MPLCountry, MPLTokenStorage, MPLKotlinThrowable, MPLKotlinArray<T>, MPLKotlinException, MPLPhoneNumber, MPLNotificationManager, MPLRpmDialogControl<T, R>, MPLScreenPresentationModel, MPLResources, MPLAuthModel, MPLMainPmDialogResult, MPLChooseCountryPmMode, MPLKotlinEnum<E>, MPLRpmDialogControlDisplay;
internal fun <T> Observable<T>.bufferValuesWhileIdle(
isIdleObservable: Observable<Boolean>,
bufferSize: Int? = null
): Observable<T> =
observable { emitter->
val compositeDisposable = CompositeDisposable()
emitter.setDisposable(compositeDisposable)
var done = false
class MainViewModel : ViewModel() {
val state = State<String>(GlobalScope)
fun onCreate() {
state.value = "Hello"
}
fun newValue() {
class State<T>(private val scope: CoroutineScope, initialValue: T? = null) {
private val channel =
initialValue?.let { ConflatedBroadcastChannel(it) } ?: ConflatedBroadcastChannel()
var value: T
get() = channel.value
set(value) {
scope.launch { channel.send(value) }
}
class IdleStateScrollListener(private val analyticsFacade: AnalyticsFacade) : RecyclerView.OnScrollListener() {
fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) {
analyticsFacade.setPending(newState != RecyclerView.SCROLL_STATE_IDLE)
}
}
public class ObjectPool<T> {
private final Object poolSync = new Object();
private SparseArray<T> freePool;
private SparseArray<T> lentPool;
private PooledObjectCreator<T> objectCreator;
public ObjectPool(int initialCapacity, PooledObjectCreator<T> objectCreator) {
this.objectCreator = objectCreator;
@vchernyshov
vchernyshov / RetrofitException.java
Created September 27, 2017 20:55
RxJava2ErrorHandlingCallAdapterFactoty
import java.io.IOException;
import java.lang.annotation.Annotation;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Response;
import retrofit2.Retrofit;
public class RetrofitException extends RuntimeException {