Skip to content

Instantly share code, notes, and snippets.

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

Marco RS marcoRS

🏠
Working from home
View GitHub Profile
Process: com.thisclicks.wiw, PID: 12734
rx.exceptions.OnErrorFailedException: Error occurred when trying to propagate error to Observer.onError
at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:192)
at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:68)
at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71)
at rx.internal.operators.OperatorMerge$MergeSubscriber.reportError(OperatorMerge.java:243)
// Not working...
.getVolumesByLanguageCode(database, "ENG")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.flatMap(new Func1<List<Volume>, Observable<Volume>>() {
@Override public Observable<Volume> call(List<Volume> volumes) {
return Observable.from(volumes);
}
})
@marcoRS
marcoRS / gist:22bbdb4924b443ce490c
Last active August 29, 2015 14:25
fetchForUser Refactored
public static void fetchForUser(final Context ctx, RJUser user, final SpotResponse listener) {
JourneyRequest.getInstance(ctx).startAsync(SpotRoutes.userSpots(user.getId()), new JourneyRequest.RequestArrayListener() {
@Override
public void onSuccess(JSONArray response) {
Realm realm = Realm.getInstance(ctx);
realm.beginTransaction();
try {
RealmList<RJSpot> spots = new RealmList<>();
@marcoRS
marcoRS / gist:3f6f469b291183690e94
Created June 25, 2015 20:50
Background Thread
public class MainActivity extends AppCompatActivity {
public static final String TAG = "MainActivity";
/** You can also choose a cached thread pool to run threads in parallel. */
public static final Executor sExecutor = Executors.newSingleThreadExecutor();
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
}
[user]
name = your-name
email = your-email
[alias]
la = config -l | grep alias | cut -c 7-
cm = commit -am
co = checkout
s = status
b = branch -a
# Log display from screencast, with train tracks.
@marcoRS
marcoRS / square_proguard
Last active May 29, 2017 12:43
Retrofit, OkHttp, Gson, Dagger Proguard Configuration
# Retrofit, OkHttp, Gson
-keepattributes *Annotation*
-keepattributes Signature
-keep class com.squareup.okhttp.** { *; }
-keep interface com.squareup.okhttp.** { *; }
-dontwarn com.squareup.okhttp.**
-dontwarn rx.**
-dontwarn retrofit.**
-keep class retrofit.** { *; }
-keepclasseswithmembers class * {