Skip to content

Instantly share code, notes, and snippets.


Tim Rijckaert timrijckaert

View GitHub Profile
timrijckaert / Cell.kt
Last active Oct 22, 2021
Similar to how Jetpack Compose's Modifier works, but for Cell NEBA
View Cell.kt
package com.bnpp.easybanking.zeplin.molecule
import androidx.annotation.StringRes
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import com.bnpp.easybanking.zeplin.molecule.CellData.Companion.DefaultMaxLines
import com.bnpp.easybanking.zeplin.molecule.CellData.Companion.DefaultTextDecoration
import com.bnpp.easybanking.zeplin.molecule.CellData.Companion.DefaultTextModifier
View FlowPlaygroundTest.kt
interface FlowProvider {
fun returnsAColdFlow(): Flow<Int> = flow {
repeat(5) {
object DefaultFlowProvider : FlowProvider
View arrowInjekt.kt
package com.example.sample
import arrow.core.Either
import arrow.core.NonEmptyList
import arrow.core.computations.either
import arrow.core.flatMap
import arrow.core.nonEmptyListOf
import arrow.core.right
import arrow.core.traverseEither
timrijckaert / either.kt
Created Feb 18, 2021
Shameless copied from Arrow Core. However this is ideal to introduce your team to Either without making a big fuzz about adding a new lib with new paradigms.
View either.kt
sealed class Either<out A, out B> {
internal abstract val isRight: Boolean
internal abstract val isLeft: Boolean
fun isLeft(): Boolean = isLeft
timrijckaert / CreditCardFormattingTextWatcher.kt
Created Jan 23, 2021
Inserts spaces after every block of 4 digits
View CreditCardFormattingTextWatcher.kt
class CreditCardTextWatcher(private val maxLength: Int) : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {}
override fun afterTextChanged(s: Editable) {
val textLength = s.length
// first remove any previous span
val spans = s.getSpans(0, s.length,
for (i in spans.indices) {
timrijckaert /
Last active Oct 7, 2020
Fetch Firebase tokens for topic

Firebase Topic Counter

This little script will output the amount of tokens subscribed to a topic.
You will need to replace the variables with your personal ones in order for it to work.

We used this function in a Lambda which sends the results to a monitoring dashboard.

How to get the variables

Screenshots in the comments.

timrijckaert / AndroidManifest.xml
Last active May 2, 2020
Test rule that disables animations and softkeyboard before any test. Easy access function to control demo modus on API 23 and up devices
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<!-- Place this permission in your debug folder -->
<uses-permission android:name="android.permission.SET_ANIMATION_SCALE"/>
timrijckaert / image-comparator
Last active Dec 20, 2019
A simple Python script used for comparing two folders containing screenshots after an Espresso/Spoon run. One folder contains your base screenshots the other folder your newly screenshots. Use this as your last regression resort to see if Espresso overlooked something.
View image-comparator
import glob
import os
import sys
from subprocess import Popen, PIPE
# Script that will compare screenshots to a set of previous screenshots
# first arg: full path to base screenshots
# second arg: full path to spoon output dir
timrijckaert /
Created Oct 4, 2016
A snap helper that has a notion of Gravity and will snap accordingly
package be.tim.rijckaert.snaprecyclerview;
View create-big-content-view.kt
private fun createBigContentView(text: String, bigImage: Bitmap, pill: Bitmap) =
RemoteViews(context.packageName, R.layout.notification_big_content_view).apply {
setImageViewBitmap(, bigImage)
setImageViewBitmap(, pill)
setTextViewText(, text)