View ColdReactiveDataExpiration.java
import com.jakewharton.rxrelay2.BehaviorRelay;
import com.jakewharton.rxrelay2.Relay;
import io.reactivex.Observable;
import java.util.concurrent.TimeUnit;
public class ColdReactiveDataExpiration {
// Problems to solve:
// 1- UI components should be notified when data is updated
View HotReactiveDataExpiration.java
import com.jakewharton.rx.ReplayingShare;
import com.jakewharton.rxrelay2.PublishRelay;
import com.jakewharton.rxrelay2.Relay;
import io.reactivex.Observable;
import java.util.concurrent.TimeUnit;
public class HotReactiveDataExpiration {
// Problems to solve:
View HotReactiveData.java
import com.jakewharton.rx.ReplayingShare;
import com.jakewharton.rxrelay2.PublishRelay;
import com.jakewharton.rxrelay2.Relay;
import io.reactivex.Observable;
import java.util.concurrent.TimeUnit;
public class HotReactiveData {
// Problems to solve:
View flavor_names_build.gradle
android {
applicationVariants.all { variant ->
def flavor = variant.mergedFlavor
def name = flavor.getVersionName()
def versionName = name + '-' + variant.properties.get('flavorName')
if (variant.buildType.isDebuggable()) {
versionName += '-debug';
}
flavor.versionName = versionName;
}
View BaseFragment.java
public class BaseFragment extends Fragment {
private boolean fragmentResume=false;
private boolean fragmentVisible=false;
private boolean fragmentOnCreated=false;
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
View proguard-rules.pro
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
### RxJava, RxAndroid (https://gist.github.com/kosiara/487868792fbd3214f9c9)
-keep class rx.schedulers.Schedulers {
public static <methods>;
View .bash_profile
#### cd to the path of the front Finder window
cdf() {
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'`
if [ "$target" != "" ]; then
cd "$target"; pwd
else
echo 'No Finder window found' >&2
fi
}
View README.md

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

View RetryWithDelay.java
public class RetryWithDelay implements Func1<Observable<? extends Throwable>, Observable<?>> {
private int numberOfTry;
private int delay;
private int retryCount = 1;
private final TimeUnit timeUnit;
public RetryWithDelay(int numberOfTry, int delay, TimeUnit timeUnit) {
this.numberOfTry = numberOfTry;
this.delay = delay;
View HttpStatusCodeHelper.java
public class HttpStatusCodeHelper {
/**
* Gets Http Status Code Information for given Code. No Reflection, No Enum
* @param code
* @return type + text
*/
public static String getHttpTypeAndTextByCode(final int code) {
//region 1xx