Skip to content

Instantly share code, notes, and snippets.


Sebastian Sellmair sellmair

View GitHub Profile
View A_KN_1.kt
interface LoginViewModel {
/* Inputs */
val userName: Subject<String>
val password: Subject<String>
val passwordRepetition: Subject<String>
val login: Trigger
/* Outputs */
View helpmeplease.js
if (typeof kotlin === 'undefined') {
throw new Error("Error loading module 'output'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'output'.");
var output = function (_, Kotlin) {
'use strict';
var throwUPAE = Kotlin.throwUPAE;
var Unit = Kotlin.kotlin.Unit;
var IllegalStateException_init = Kotlin.kotlin.IllegalStateException_init;
var toString = Kotlin.toString;
var println =$;
View Disposing on Android 3.kt
class MainActivity : AppCompatActivity() {
private lateinit var textView: TextView
override fun onCreate(savedInstanceState: Bundle?) {
textView = findViewById(
sellmair / Disposing on Android 2.kt
Created Sep 30, 2018
Disposing on Android 2.kt
View Disposing on Android 2.kt
class MyActivity: AppCompatActivity() {
private val lifecycleProvider = AndroidLifecycle.createLifecycleProvider(::getLifecycle)
fun onCreate() {
sellmair / Disposing on Android 1.kt
Last active Oct 1, 2018
Disposing on Android 1
View Disposing on Android 1.kt
class MyActivity {
var fetchDataDisposable: Disposable? = null
/* ... */
fun onCreate() {
/* stuff */
View CbI-compose2.kt
val patternDetector: PatternDetector = (TrendDownPatternDetector().combineWithoutOverlap(TrendUpPatternDetector()))
View PatternDetector+combineWithoutOverlap.kt
fun PatternDetector.combineWithoutOverlap(other: PatternDetector): PatternDetector {
return OverlapFreePatternConnector(this, other)
View CbI-OverlapFreePatternDetectorConnector.kt
class OverlapFreePatternDetectorConenctor (
private val first: PatternDetector,
private val second: PatternDetector): PatternDetector {
override fun findPatterns(data: List<Weight>): List<Pattern> {
val firstPatterns = first(data)
val secondPatterns = second(data)
val overlaps = overlaps(firstPatterns, secondPatterns)
View CbI-compose1.kt
val patternDetector: PatternDetector = TrendDownPatternDetector()
View CbI-PatternDetector+combine.kt
fun PatternDetector.combine(other: PatternDetector): PatternDetector {
return PatternDetectorConnector(this, other)