Skip to content

Instantly share code, notes, and snippets.

View MrOnyszko's full-sized avatar

Sławomir Onyszko MrOnyszko

View GitHub Profile
@cesarferreira
cesarferreira / RxJava.md
Last active February 2, 2022 07:28
Party tricks with RxJava, RxAndroid & Retrolambda

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
@jimschubert
jimschubert / .gitignore
Last active November 16, 2023 04:16
Prototyping a Flags/Bitmasks implementation in Kotlin 1.1.1
META-INF/
*.class
@dekassegui
dekassegui / sqlite_string_split.sql
Last active December 3, 2022 19:35
SQlite only -- snippet to demonstrate how to SPLIT STRING in substrings separated with custom separators.
with separators as ( values (' '), (','), ('-'), ('.') ),
source (s) as ( select " Will, thought and action." ),
bag (q) as ( -- POSITIONS OF ALL SEPARATORS
with dim (len) as ( select length(s) from source ),
ndx (n) as (
select 1 union all select n+1 from ndx, dim where n < len
) select 0 --> PSEUDO SEPARATOR IN FRONT OF SOURCE STRING
union all select n from ndx, source where substr(s, n, 1) in separators
union all select len+1 from dim --> PSEUDO SEPARATOR AT BOTTOM
),