Skip to content

Instantly share code, notes, and snippets.

View mohamad-amin's full-sized avatar

Mohamad Amin Mohamadi mohamad-amin

View GitHub Profile
@adavis
adavis / CommonExtensions.kt
Last active April 2, 2024 20:51
Common Android Extensions in Kotlin
fun View.visible() {
visibility = View.VISIBLE
}
fun View.invisible() {
visibility = View.INVISIBLE
}
fun View.gone() {
visibility = View.GONE
@marcelpinto
marcelpinto / ApiManager.java
Last active May 18, 2018 13:41
Cache RxJava observables on Android approach to reuse and avoid multiple calls.
private ObservableManager obsManager = new ObservableManager(EventBus.getDefault());
@Override
public Subscription getStores() {
// Get the observable if exists and is not too old
Observable<StoresList> observable = obsManager.get(ObservableManager.Types.STORES);
if (observable == null) {
// If is null create it and us cache to keep it in memeroy
observable = api.getStoresList()
.compose(applySchedulers(api.getStoresList()))
@aegis123
aegis123 / rules.pro
Created December 15, 2014 13:16
ProGuard and DexGuard rules
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
#your package path where your gson models are stored
-keep class com.project.models.** { *; }
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@tyleha
tyleha / tic-toc-python.md
Last active February 16, 2023 00:38
Building a Matlab-style timing function that can be called with the bare-minimum number of keystrokes and thought.

A Simple Python Timing Function

Overview

# What this gist provides:

tic()
'''code to be timed'''
toc()