This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> Observable<T> delayEmissions(Observable<T> observable, final long period, final TimeUnit timeUnit) { | |
return observable.compose(new Observable.Transformer<T, T>() { | |
@Override | |
public Observable<T> call(Observable<T> observable) { | |
return Observable.zip(observable, Observable.interval(period, timeUnit), new Func2<T, Long, T>() { | |
@Override | |
public T call(T value, Long tick) { | |
return value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System; | |
using System.Reflection; | |
public class WebWindow : EditorWindow { | |
static Rect windowRect = new Rect(100,100,800,600); | |
static BindingFlags fullBinding = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static; | |
static StringComparison ignoreCase = StringComparison.CurrentCultureIgnoreCase; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vinaysshenoy.matrixviewtest; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.graphics.PointF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reflog expire --all --expire=now | |
git gc --prune=now --aggressive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Observable; | |
import rx.Subscriber; | |
import rx.Subscription; | |
import rx.functions.Action0; | |
import rx.subjects.PublishSubject; | |
import rx.subjects.SerializedSubject; | |
/** | |
* An object reference of EventBus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vinaysshenoy.rxtest; | |
import android.os.Bundle; | |
import android.support.v4.util.Pair; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import android.view.View; | |
import android.widget.TextView; | |
import android.widget.Toast; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.content.res.XmlResourceParser; | |
import android.graphics.drawable.DrawableContainer; | |
import android.graphics.drawable.StateListDrawable; | |
import android.os.Build; | |
import android.os.Looper; | |
import android.support.annotation.DrawableRes; | |
import android.support.annotation.MainThread; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vinaysshenoy.utils; | |
import android.support.annotation.NonNull; | |
import android.support.v4.util.Pair; | |
import java.lang.reflect.Type; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mainLoop: | |
while (goal <= 100) { | |
for (int i = 0; i < goal; i++) { | |
if (points > 50) { | |
break mainLoop; | |
} | |
points += i; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); | |
int ipAddress = wifiManager.getConnectionInfo().getIpAddress(); | |
final String formatedIpAddress = String.format(Locale.US, "%d.%d.%d.%d", (ipAddress & 0xff), (ipAddress >> 8 & 0xff), (ipAddress >> 16 & 0xff), (ipAddress >> 24 & 0xff)); |