View DelegatingPagingSource.Kt
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 com.example.paging | |
import androidx.paging.PagingSource | |
import androidx.paging.PagingState | |
import org.orbitmvi.orbit.ContainerHost | |
import org.orbitmvi.orbit.syntax.simple.SimpleSyntax | |
import org.orbitmvi.orbit.syntax.simple.intent | |
import kotlin.coroutines.resume | |
import kotlin.coroutines.resumeWithException | |
import kotlin.coroutines.suspendCoroutine |
View jacoco.gradle
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
apply plugin: "jacoco" | |
jacoco { | |
toolVersion = deps.test.jacocoVersion | |
} | |
tasks.withType(Test) { | |
jacoco.includeNoLocationClasses = true | |
} |
View UnsafeCast.kt
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 io.techery.detekt.extensions.rules | |
import io.gitlab.arturbosch.detekt.api.* | |
import org.jetbrains.kotlin.lexer.KtTokens | |
import org.jetbrains.kotlin.psi.* | |
/** | |
* Whitelist-able unsafe cast check. E.g. | |
* | |
* UnsafeCast: |
View jenkins-android-pipeline-utils.groovy
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
#!/usr/bin/env groovy | |
def runBuild(String nodeName = null, notifyGithub = true, Closure<Void> job) { | |
if (nodeName) node(nodeName) { runBuildInternally(job, notifyGithub) } | |
else runBuildInternally(job, notifyGithub) | |
} | |
private def runBuildInternally(Closure<Void> job, boolean notifyGithub) { | |
withGithubNotifier(notifyGithub) { | |
decorateBuild { |
View TimberServiceWrapper.java
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 TimberServiceWrapper extends ActionServiceWrapper { | |
private final String serviceTag; | |
public TimberServiceWrapper(ActionService actionService) { | |
this(actionService, null); | |
} | |
public TimberServiceWrapper(ActionService actionService, String tag) { | |
super(actionService); |
View build.gradle
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
/* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2016 Piasy | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
View gist:fc76f605c03822a3ee14
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 Intent newSmsIntent(Context context, String body, String... phoneNumber) { | |
Uri smsUri; | |
if (phoneNumber == null) { | |
smsUri = Uri.parse("smsto:"); | |
} else { | |
smsUri = Uri.parse("smsto:" + Uri.encode(TextUtils.join(",", phoneNumber))); | |
} | |
Intent intent; | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
intent = new Intent(Intent.ACTION_SENDTO, smsUri); |
View ModalUrl
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
angular.module("services").factory('ModalUrl', [ | |
'$rootScope', '$modal', '$location', '$routeParams', '$window', '$timeout', | |
($rootScope, $modal, $location, $routeParams, $window, $timeout) -> | |
modalInstance = null | |
checkModal = () -> | |
modalParam = decodeURIComponent($routeParams.modal) | |
if (modalParam != 'undefined') | |
optionsParam = decodeURIComponent($routeParams.options) | |
if (optionsParam != 'undefined') | |
options = JSON.parse(optionsParam) |
View AndroidPaletteCallback
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 your.package; | |
import android.graphics.Bitmap; | |
import android.graphics.drawable.BitmapDrawable; | |
import android.support.annotation.NonNull; | |
import android.widget.ImageView; | |
public abstract class AndroidPaletteCallback extends PaletteCallback<ImageView> { | |
public AndroidPaletteCallback(@NonNull ImageView imageView) { |
View ObjectGsonParceler.java
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 ObjectGsonParceler { | |
private final Gson gson; | |
public ObjectGsonParceler(Gson gson) { | |
this.gson = gson; | |
} | |
public Parcelable wrap(Object instance) { | |
try { | |
String json = encode(instance); |
NewerOlder