Skip to content

Instantly share code, notes, and snippets.

View claudiobastos's full-sized avatar
🏠
Working from home

Cláudio Bastos claudiobastos

🏠
Working from home
  • Belo Horizonte, Brasil
View GitHub Profile
@adamcmwilson
adamcmwilson / Example.java
Created January 13, 2017 05:44
Chained Api calls with RxJava
public class Example {
private String auth_token;
private void chainApiCalls() throws Exception {
api.getToken()
.doOnNext(token -> auth_token = token)
.flatMap(api::getPersonNumber)
.flatMap(person_number -> api.getUserInfo(auth_token, person_number))
.doOnCompleted(() -> auth_token = null)
@magillus
magillus / RxBroadcastReceiver.java
Last active August 21, 2020 22:25
RxJava2.0 Broadcast Receiver for getting intent broadcasts as Observable<Intent>
/**
* RxJava based broadcast reciever that registers its local BroadcastReceiver until end of subscription.
* Listens for update and passes Intent to the Stream (Subscriber).
*
* Copyright 2016 Mateusz Perlak - http://www.apache.org/licenses/LICENSE-2.0
* Created on 11/18/16.
*/
public class RxBroadcastReceiver implements ObservableOnSubscribe<Intent> {
protected final WeakReference<Context> contextWeakReference;

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@staltz
staltz / introrx.md
Last active December 1, 2025 11:31
The introduction to Reactive Programming you've been missing
@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active August 5, 2025 08:10
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss