Skip to content

Instantly share code, notes, and snippets.

@cdsap
cdsap / StarWars.kt
Created April 5, 2019 14:43
StarWars
/*
I am your Father Luke
*/
sealed class Pronouns {
object I : Pronouns()
object You : Pronouns()
}
sealed class PronounsPer {
@cdsap
cdsap / StarWarsTest.kt
Created April 5, 2019 14:43
Test StarWars
import org.junit.Test
class StarWarsTest {
@Test
fun amIYourFather(){
// Arrange
val I = Pronouns.I
val your = PronounsPer.Your
val Luke = Characters.Luke
@cdsap
cdsap / build.gradle.kts
Created April 24, 2019 16:50
taskdependency
talaiot {
logger = LogTracker.Mode.INFO
metrics {
performanceMetrics = false
}
publishers {
taskDependencyGraphPublisher {
gexf = true
dot = true
@cdsap
cdsap / test.csv
Last active May 1, 2019 05:48
test
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 23 columns, instead of 5 in line 8.
Id,Label,timeset,module,cached,indegree,outdegree,Degree,weighted indegree,weighted outdegree,Weighted Degree,Eccentricity,closnesscentrality,harmonicclosnesscentrality,betweenesscentrality,Authority,Hub,modularity_class,pageranks,componentnumber,strongcompnum,clustering,eigencentrality
0,preBuild,,:core,false,1,0,1,1,0,1,0,0,0,0,0,0,1,0.117565,0,0,0,0.399217
1,preBuild,,:bypass,false,1,0,1,1,0,1,0,0,0,0,0,0,0,0.085248,0,1,0,0.213186
2,preDebugBuild,,:bypass,false,12,1,13,12,1,13,1,1,1,35,0.001708,0,0,0.093233,0,2,0.064103,0.573833
3,preDebugBuild,,:core,false,23,1,24,23,1,24,1,1,1,35,0.435526,0,1,0.131221,0,3,0.057971,1
4,compileDebugAidl,,:bypass,false,4,1,5,4,1,5,2,0.666667,0.75,5.9,0.012932,0.000265,0,0.016994,0,4,0.15,0.206079
5,compileDebugAidl,,:core,false,6,2,8,6,2,8,3,0.555556,0.666667,15.733333,0.33088,0.069577,2,0.013052,0,5,0.160714,0.190798
6,compileDebugRenderscript,,:bypass,false,4,1,5,4,1,5,2,0.666667,0.75,2.166667,0.002191,0.000265,0,0.016219,0,6,0.15,0.137832
7,checkDebugManifest,,:bypass,fa
@cdsap
cdsap / build.csv
Created April 30, 2019 05:02
Complete Output
Id Label timeset module cached indegree outdegree Degree weighted indegree weighted outdegree Weighted Degree Eccentricity closnesscentrality harmonicclosnesscentrality betweenesscentrality Authority Hub modularity_class pageranks componentnumber strongcompnum clustering eigencentrality
0 clean no_module false 0 0 0 0 0 0 0 0 0 0 0 0 0 0.000848 0 0 0 0
1 clean :about false 0 0 0 0 0 0 0 0 0 0 0 0 1 0.000848 1 1 0 0
2 clean :bypass false 0 0 0 0 0 0 0 0 0 0 0 0 2 0.000848 2 2 0 0
3 clean :dribbble false 0 0 0 0 0 0 0 0 0 0 0 0 3 0.000848 3 3 0 0
4 clean :designernews false 0 0 0 0 0 0 0 0 0 0 0 0 4 0.000848 4 4 0 0
5 clean :search false 0 0 0 0 0 0 0 0 0 0 0 0 5 0.000848 5 5 0 0
6 clean :test_shared false 0 0 0 0 0 0 0 0 0 0 0 0 6 0.000848 6 6 0 0
7 clean :app false 0 0 0 0 0 0 0 0 0 0 0 0 7 0.000848 7 7 0 0
8 preBuild :about false 1 0 1 1 0 1 0 0 0 0 0.002987 0 10 0.004034 8 8 0 0.074131
package timoptr.multiselectablelist.sample
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import io.reactivex.disposables.CompositeDisposable
@cdsap
cdsap / CommonPlugin.kt
Last active May 19, 2019 01:04
commonplugin
class LibraryCommonPlugin : Plugin<Project> {
override fun apply(target: Project) {
target.plugins.apply("com.android.library")
val extension = target.extensions.getByType<LibraryExtension>()
extension.configure()
}
}
fun LibraryExtension.configure() {
setCompileSdkVersion(28)
defaultConfig {
minSdkVersion(21)
targetSdkVersion(28)
versionCode = 1
versionName = "1.1"
}
}
@cdsap
cdsap / build.gradle
Created May 17, 2019 03:20
buildgradle
apply plugin: 'libraryCommonPlugin'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
}
@cdsap
cdsap / build.gradle.kts
Created May 17, 2019 03:22
build.gradle2
gradlePlugin {
plugins {
register("LibraryCommonPlugin") {
id = "libraryCommonPlugin"
implementationClass = "com.plugin.LibraryCommonPlugin"
}
}
}