Skip to content

Instantly share code, notes, and snippets.

@Nomane
Nomane / bump-version.sh
Last active January 15, 2024 02:49
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
@starkej2
starkej2 / RxImmediateSchedulerRule.kt
Last active December 30, 2021 18:33
RxJava Immediate Scheduler Test Rule
/**
* Replaces the default RxJava schedulers with a synchronous one.
*/
class RxImmediateSchedulerRule : TestRule {
private val immediateScheduler = object : Scheduler() {
@NonNull
override fun scheduleDirect(run: Runnable, delay: Long, unit: TimeUnit): Disposable {
// Hack to prevent stack overflows in unit tests when scheduling with a delay;
return super.scheduleDirect(run, 0, unit)
}
@romannurik
romannurik / DrawInsetsFrameLayout.java
Created February 10, 2014 16:28
DrawInsetsFrameLayout — adding additional background protection for system UI chrome when using KitKat’s translucent decor flags.
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software