Skip to content

Instantly share code, notes, and snippets.

Tim Rijckaert timrijckaert

Block or report user

Report or block timrijckaert

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
timrijckaert /
Last active May 16, 2019
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.

View big-content-view-builder.kt
private fun createNotification(channelId: String, text: String, title: String, id: String, url: String, bigImage: Bitmap, pillImage: Bitmap): Notification {
return NotificationCompat.Builder(context, channelId)
.setContentIntent(createPendingIntent(id, url))
View drawPillViewOnCanvas.kt
PillView(context).run {
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
val bitmap = Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_4444)
val canvas = Canvas(bitmap)
layout(0, 0, measuredWidth, measuredHeight)
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)
View notification_big_content_gradient_overlay
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android=""
View notificationBuilder.kt
private fun createNotification(channelId: String, text: String, title: String, id: String, url: String, bitmap: Bitmap): Notification {
return NotificationCompat.Builder(context, channelId)
.setContentIntent(createPendingIntent(id, url))
timrijckaert / output.json
Created Dec 6, 2018
Scrapes the contents from the site in an easier to read JSON format. Open developer console and paste following code.
View output.json
timrijckaert / image-comparator
Last active Aug 16, 2018
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
private static class ImmediateSchedulersRule implements TestRule {
public Statement apply(final Statement base, Description description) {
return new Statement() {
public void evaluate() throws Throwable {
RxJavaPlugins.setIoSchedulerHandler(scheduler ->
RxJavaPlugins.setComputationSchedulerHandler(scheduler ->
View install-test-butler.python
APK_NAME = "test-butler-app-1.2.0.apk"
def install_test_butler(device_id):
is_emulator = device_id.startswith("emulator")
if is_emulator:
install_cmd = "adb -s %s install -r %s" % (device_id, APK_NAME)
subprocess.Popen(install_cmd, shell=True, stdout=subprocess.PIPE)
print "TestButler was installed on device with id: %s" % device_id
You can’t perform that action at this time.