Skip to content

Instantly share code, notes, and snippets.


David Rawson drawers

View GitHub Profile
LordRaydenMK / ValueClass.kt
Created February 2, 2020 22:09
Kotlin compiler plugin built with arrow-meta. Generates equals, hashCode and toString for classes annotated with @valueclass
View ValueClass.kt
annotation class ValueClass
timrijckaert /
Created March 5, 2017 22:35
RxJava2 Rule to change the Schedulers to immediate one. (
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 ->
rnkoaa /
Created January 11, 2017 18:12
Convert a listenable future to an rxjava-2 flowable or single
import io.reactivex.*;
* Created on 1/11/2017.
public class FlowableUtils {
webserveis / material text
Last active November 29, 2022 04:19 — forked from passsy/material text
Material font sizes
View material text

Material text sizes XML for Android

Simple helper file for standard text sizes in material design. The sizes are provided by the material design documentation

material typography

Standard Styles

Too many type sizes and styles at once can wreck any layout. A typographic scale is a limited set of type sizes that work well together, along with the layout grid. The basic set of styles are based on a typographic scale of 12, 14, 16, 20, and 34.

Tetr4 /
Last active February 1, 2020 05:17
How to force a cached or network response on Android with Retrofit + OkHttp
OkHttpClient okHttpClient = new OkHttpClient();
try {
int cacheSize = 10 * 1024 * 1024 // 10 MiB
Cache cache = new Cache(getCacheDir(), cacheSize);
} catch (IOException e) {
Log.e(TAG, "Could not set cache", e);
// Forces cache. Used for cache connection
hvkale / colors.xml
Last active February 3, 2023 19:08
Material Design Color Palette Colors.xml Resource file for Android
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
Google Material Design Color Palette for Android
Spreadsheet used to create this reosurce -
Link to this colors.xml resource file -
Harshad Kale