Skip to content

Instantly share code, notes, and snippets.

Christian Passold Chrispassold

Block or report user

Report or block Chrispassold

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
luisfelipeas5 /
Last active Oct 31, 2019
Um guia para configurar o básico do SonarQube + Jacoco

Adicione o plugin do SonarQube

Primeiro, adicione ao build.gradle de nível de projeto:

buildscript {
   repositories {
       maven {
           url ""


Kotlin Tools for Android ViewModel, LiveData, Data Binding, Dependency injection, Async operations, Repository pattern, Retrofit, Form Validation, Cloud Firestore, etc.

OmkarAmberkar / NetworkBoundResource.kt
Last active Jan 21, 2020
NetworkBoundResource with RxJava and Kotlin sealed classes
View NetworkBoundResource.kt
abstract class NetworkBoundResource<ResultType, RequestType>(context: Context) {
private val result: Flowable<Resource<ResultType>>
init {
// Lazy disk observable.
val diskObservable = Flowable.defer {
// Read from disk on Computation Scheduler
arekolek / LiveDataReactiveStreamsActivity.kt
Last active Jan 30, 2020
Using LiveDataReactiveStreams to handle lifecycle and threading while computing list diff for recycler view
View LiveDataReactiveStreamsActivity.kt
package com.github.arekolek.diffutil
import android.arch.lifecycle.*
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
maiconhellmann / UnsafeHttpClient.kt
Created Nov 21, 2017
UnsafeHttpClient wrote in Kotlin
View UnsafeHttpClient.kt
import okhttp3.OkHttpClient
class UnsafeOkHttpClient {
companion object {
fun getUnsafeOkHttpClient(): OkHttpClient.Builder {
try {
karthiks /
Last active Aug 22, 2018
Create NotificationChannel object per Channel, with the desired options
public class NotificationUtils extends ContextWrapper {
public static final String ANDROID_CHANNEL_ID = "com.androidstuff.tutsplustalerts.ANDROID";
public static final String IOS_CHANNEL_ID = "com.androidstuff.tutsplustalerts.IOS";
public static final String ANDROID_CHANNEL_NAME = "ANDROID CHANNEL";
public static final String IOS_CHANNEL_NAME = "IOS CHANNEL";
private NotificationManager notificationManager;
public NotificationUtils(Context base) {
tinmegali / LiveData.ext.kt
Created Jul 14, 2017
Kotlin extension to allow Unit tests on Android LiveData
View LiveData.ext.kt
import android.arch.lifecycle.LiveData
import android.arch.lifecycle.Observer
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
// Extension to allow unit tests on LiveData
// discussion on:
Jeevuz / Extensions.kt
Last active Mar 27, 2020
Here I collect some of my most useful Kotlin extensions
View Extensions.kt
inline fun SharedPreferences.edit(changes: SharedPreferences.Editor.() -> SharedPreferences.Editor) {
fun ImageView.tintSrc(@ColorRes colorRes: Int) {
val drawable = DrawableCompat.wrap(drawable)
DrawableCompat.setTint(drawable, ContextCompat.getColor(context, colorRes))
if (drawable is TintAwareDrawable) invalidate() // Because in this case setImageDrawable will not call invalidate()
sheharyarn /
Created May 13, 2017
Set Empty Layout for RecyclerViews in Android
* Custom implementation of AdapterDataObserver to show empty layouts
* for RecyclerView when there's no data
* Usage:
* adapter.registerAdapterDataObserver(new RVEmptyObserver(recyclerView, emptyView));
public class RVEmptyObserver extends RecyclerView.AdapterDataObserver {
private View emptyView;
javilobo8 / download-file.js
Last active Mar 31, 2020
Download files with AJAX (axios)
View download-file.js
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
You can’t perform that action at this time.