Skip to content

Instantly share code, notes, and snippets.


Mohammed Audhil Audhil

Block or report user

Report or block Audhil

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
LouisCAD / LifecycleCoroutines.kt
Last active Oct 15, 2019
CoroutineScope and Job integration with Lifecycle for Android. Meant to be used for your coroutines in lifecycle aware components. OUTDATED. See up to date implementation here:
View LifecycleCoroutines.kt
import android.arch.lifecycle.GenericLifecycleObserver
import android.arch.lifecycle.Lifecycle
import android.arch.lifecycle.Lifecycle.Event.ON_DESTROY
import android.arch.lifecycle.LifecycleOwner
import kotlinx.coroutines.experimental.CoroutineScope
import kotlinx.coroutines.experimental.Dispatchers
import kotlinx.coroutines.experimental.Job
fun Lifecycle.createJob(cancelEvent: Lifecycle.Event = ON_DESTROY): Job {
koesie10 /
Created Oct 3, 2015
Retrofit 1 error handling behaviour in Retrofit 2
// Dagger 1 example
complete = false,
library = true
public final class ApiModule {
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
tejainece /
Last active Jul 22, 2019
Get element by index in LinkedHashMap
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
public class LinkedHashMapValueByIndexArray {
public static void main(String []args){
LinkedHashMap<String, Integer> map = new LinkedHashMap<String, Integer>();
map.put("Qatar", 98814);
CristinaSolana / gist:1885435
Created Feb 22, 2012
Keeping a fork up to date
View gist:1885435

1. Clone your fork:

git clone

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://
git fetch upstream
You can’t perform that action at this time.