Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mohammed Audhil Audhil

🎯
Focusing
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
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: https://github.com/LouisCAD/Splitties/tree/master/modules/lifecycle-coroutines
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
import kotlinx.coroutines.experimental.android.Main
fun Lifecycle.createJob(cancelEvent: Lifecycle.Event = ON_DESTROY): Job {
@koesie10
koesie10 / ApiModule.java
Created Oct 3, 2015
Retrofit 1 error handling behaviour in Retrofit 2
View ApiModule.java
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
@tejainece
tejainece / LinkedHashMapValueByIndexArray.java
Last active Jul 22, 2019
Get element by index in LinkedHashMap
View LinkedHashMapValueByIndexArray.java
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
CristinaSolana / gist:1885435
Created Feb 22, 2012
Keeping a fork up to date
View gist:1885435

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

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

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
You can’t perform that action at this time.