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.content.SharedPreferences | |
import kotlin.properties.ReadWriteProperty | |
import kotlin.reflect.KProperty | |
abstract class BasePreferencesDataSource { | |
protected abstract val preferences : SharedPreferences | |
protected class StringPrefProperty(private val key: String) : ReadWriteProperty<BasePreferencesDataSource, String> { |
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.mrezanasirloo.ganjeh | |
import android.util.SparseArray | |
import androidx.activity.ComponentActivity | |
import androidx.annotation.MainThread | |
import androidx.fragment.app.Fragment | |
import androidx.fragment.app.createViewModelLazy | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelLazy |
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 abstract class ResponseWithErrorHandling<R, E> implements Callback<ResponseBody> { | |
private Type responseType; | |
private Type errorType; | |
public abstract void onResponseRequest(Call<ResponseBody> call, R response); | |
public abstract void onErrorRequest(Call<ResponseBody> call, E error); | |
public abstract void onFailureRequest(Call<ResponseBody> call, Throwable error); |
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
SSL Certificate error: | |
- To permanently accept a specific certificate | |
1. Initial clone | |
- GIT_SSL_CAINFO=/path/to/cert.pem git clone https://repo.or.cz/org-mode.git | |
2. Ensure all future interactions with origin remote also work | |
- cd my-repo-directory | |
- git config http.sslCAInfo /etc/ssl/certs/rorcz_root_cert.pem | |
- To disable TLS/SSL verification for a single git command | |
git -c http.sslVerify=false clone https://domain.com/path/to/git | |
- To disable SSL verification for that singular repository |
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
# 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>; |