Skip to content

Instantly share code, notes, and snippets.

View yosriz's full-sized avatar

Yossi Rizgan yosriz

View GitHub Profile
@yosriz
yosriz / toBlockNumArg.go
Created November 20, 2017 11:51
ethclient.toBlockNumArg()
func toBlockNumArg(number *big.Int) string {
if number == nil {
return "latest"
}
return hexutil.EncodeBig(number)
}
@yosriz
yosriz / types.go
Created November 20, 2017 11:47
types.go
const (
PendingBlockNumber = BlockNumber(-2)
LatestBlockNumber = BlockNumber(-1)
EarliestBlockNumber = BlockNumber(0)
)
@yosriz
yosriz / ExhaustMapTransformer.java
Created May 29, 2017 06:50
RxJava2 Exhaust Map - ignore (drop) incoming requests while work is in progress
import java.util.concurrent.atomic.AtomicBoolean;
import io.reactivex.Observable;
import io.reactivex.ObservableTransformer;
import io.reactivex.functions.Function;
class ExhaustMapTransformer<Upstream, Downstream> implements ObservableTransformer<Upstream, Downstream> {
private final AtomicBoolean workInProgress = new AtomicBoolean(false);
private final Function<Upstream, Observable<Downstream>> mapper;
package com.siplay.android_siplay.helper;
import android.support.annotation.CallSuper;
import retrofit2.Response;
/**
* Created by Agustin Tomas Larghi on 20/04/2017.
* Email: agustin.tomas.larghi@gmail.com
*/