Skip to content

Instantly share code, notes, and snippets.

@hamidp
hamidp / ContinueWithIfEmptyOperator.java
Created October 13, 2014 18:04
ContinueWithIfEmpty operator
package com.trello.core.rx;
import rx.Observable;
import rx.Subscriber;
/**
* Passes control to another Observable if the source observable does not emit any items.
*
* Handy if you've a CacheObservable that does a cheap lookup and a DoHardWorkObservable that does the
* hard work and you want to only do the hard work if CacheObservable is empty.
@hamidp
hamidp / gist:1088091
Created July 17, 2011 21:34
Ruby Pipeline
def method_missing(sym, *args)
if(sym.to_s == "pl")
send(args[0], self)
end
end
def square ar
ar.map! { |i| i * i }
end