Skip to content

Instantly share code, notes, and snippets.

pablichjenkov pablichjenkov

  • Abbott Labs
  • Miami, Fl
Block or report user

Report or block pablichjenkov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gpeal / SimpleDemo.kt
Last active Aug 28, 2018
Airbnb MvRx Early Look
View SimpleDemo.kt
data class SimpleDemoState(val listing: Async<Listing> = Uninitialized)
class SimpleDemoViewModel(override val initialState: SimpleDemoState) : MvRxViewModel<SimpleDemoState>() {
init {
private fun fetchListing() {
// This automatically fires off a request and maps its response to Async<Listing>
// which is a sealed class and can be: Unitialized, Loading, Success, and Fail.
elye / Kotlin Date Iterator
Last active Feb 26, 2019
Kotlin Date Iterator
View Kotlin Date Iterator
class TestingClass {
fun testingFunction() {
for (everyday in this year 2017) {
// Do something with everyday
private infix fun year(year: Int): DateRange {
return Date(year, 1, 1)..Date(year, 12, 31)
import rx.Observable;
import rx.subjects.PublishSubject;
import rx.subjects.SerializedSubject;
import rx.subjects.Subject;
* Simple pass-thru event bus with error handling and reconnect.
public class EventBus {
justasm /
Last active Apr 21, 2019
OkHttp 3 non-persistent CookieJar with an ACCEPT_ALL policy
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
hameno / ExtendedFileProvider
Last active May 2, 2019
"Enhanced" FileProvider with support for external secondary paths (based on 27.0.2)
View ExtendedFileProvider
* Copyright (C) 2013 The Android Open Source Project
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
vemilyus / ActorState.kt
Created Dec 30, 2018
Sample implementation of ActorState with read-write separation
View ActorState.kt
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.ObsoleteCoroutinesApi
import kotlinx.coroutines.isActive
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlin.coroutines.CoroutineContext
interface ActorState<T : Any> : CoroutineScope {
FavoRiteKK / EndlessRecyclerScrollListener
Created Oct 27, 2017
[Android] Endless load more for RecyclerView
View EndlessRecyclerScrollListener
public abstract class EndlessRecyclerScrollListener extends RecyclerView.OnScrollListener {
// The minimum amount of items to have below your current scroll position
// before loading more.
y-polek /
Last active Sep 5, 2019
adb commands to test Doze mode
#! /bin/zsh
# Buttery powered state
adb shell dumpsys battery | grep powered
# Unplug battery
adb shell dumpsys battery unplug
# Reset battery
adb shell dumpsys battery reset
View animated_visibility.kt
/* Copyright 2019 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
fun animateVisibility(view: View, visible: Boolean) {
val targetAlpha = if (visible) 1f else 0f
if (view.alpha == targetAlpha) return
view.visibility = View.VISIBLE
val spring = view.spring(SpringAnimation.ALPHA)
(view.getTag( as?
DynamicAnimation.OnAnimationEndListener)?.let {
orj / .gitconfig
Created May 27, 2011
Using p4merge as Git mergetool on Mac OS X.
View .gitconfig
keepBackup = false
tool = custom
[mergetool "custom"]
cmd = /Applications/ "$PWD/$BASE" "$PWD/$REMOTE" "$PWD/$LOCAL" "$PWD/$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
You can’t perform that action at this time.