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
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(R.id.tag_pending_end_listener) as?
DynamicAnimation.OnAnimationEndListener)?.let {
@vemilyus
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.channels.actor
import kotlinx.coroutines.isActive
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlin.coroutines.CoroutineContext
interface ActorState<T : Any> : CoroutineScope {
@y-polek
y-polek / doze_mode_adb_commands.sh
Last active Sep 5, 2019
adb commands to test Doze mode
View doze_mode_adb_commands.sh
#! /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
@gpeal
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 {
fetchListing()
}
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.
@ericwindmill
ericwindmill / form_page.dart
Created Apr 14, 2018
Flutter Simple inherited Widget Example
View form_page.dart
import 'package:flutter/material.dart';
import 'package:simple_inherit/state_container.dart';
class UpdateUserScreen extends StatelessWidget {
static final GlobalKey<FormState> formKey = new GlobalKey<FormState>();
static final GlobalKey<FormFieldState<String>> firstNameKey =
new GlobalKey<FormFieldState<String>>();
static final GlobalKey<FormFieldState<String>> lastNameKey =
new GlobalKey<FormFieldState<String>>();
static final GlobalKey<FormFieldState<String>> emailKey =
@hameno
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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@FavoRiteKK
FavoRiteKK / EndlessRecyclerScrollListener
Created Oct 27, 2017
[Android] Endless load more for RecyclerView
View EndlessRecyclerScrollListener
package com.estate.mrnx.tb.custom.refresharticle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
public abstract class EndlessRecyclerScrollListener extends RecyclerView.OnScrollListener {
// The minimum amount of items to have below your current scroll position
// before loading more.
@elye
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
println(everyday.toString())
}
}
private infix fun year(year: Int): DateRange {
return Date(year, 1, 1)..Date(year, 12, 31)
@patpohler
patpohler / Big List of Real Estate APIs.md
Last active Nov 17, 2019
Evolving list of Real Estate APIs by Category
View Big List of Real Estate APIs.md

Big List of Real Estate APIs

Listings / Property Data

####Rets Rabbit http://www.retsrabbit.com

Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.

@swankjesse
swankjesse / QuotePreservingCookieJar.java
Created Oct 4, 2016
Like our JavaNetCookieJar, but preserve quote characters.
View QuotePreservingCookieJar.java
/*
* Copyright (C) 2016 Square, Inc.
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
You can’t perform that action at this time.