This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Action1<Throwable> crashOnError() { | |
final Throwable checkpoint = new Throwable(); | |
return throwable -> { | |
StackTraceElement[] stackTrace = checkpoint.getStackTrace(); | |
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()` | |
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)", | |
element.getClassName(), | |
element.getMethodName(), | |
element.getFileName(), | |
element.getLineNumber()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NetworkHelper { | |
private OkHttpClient okHttpClient; | |
private Gson gson; | |
public NetworkHelper(OkHttpClient okHttpClient, Gson gson) { | |
this.okHttpClient = okHttpClient; | |
this.gson = gson; | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.support.annotation.Nullable; | |
import android.support.v4.util.ArrayMap; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.StaggeredGridLayoutManager; | |
import android.view.ViewGroup; | |
import java.util.List; | |
public abstract class SectionedRecyclerViewAdapter<VH extends RecyclerView.ViewHolder> | |
extends RecyclerView.Adapter<VH> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RxErrorCallAdapterFactory extends CallAdapter.Factory { | |
@Override | |
public CallAdapter<?> get(Type returnType, Annotation[] annotations, Retrofit retrofit) { | |
Class<?> rawType = getRawType(returnType); | |
String canonicalName = rawType.getCanonicalName(); | |
boolean isSingle = rawType == Single.class; | |
boolean isCompletable = rawType == Completable.class; | |
// Return type not a Rx type. | |
if (rawType != Observable.class && !isSingle && !isCompletable) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am kalpeshp0310 on github. | |
* I am kalpeshp0310 (https://keybase.io/kalpeshp0310) on keybase. | |
* I have a public key ASB_knuOKyWEsobqePLKR0ClYdSgfgAV7qUs908zgUiQDgo | |
To claim this, I am signing this object: |