Skip to content

Instantly share code, notes, and snippets.

View osama-raddad's full-sized avatar
💻
Working

Osama Raddad osama-raddad

💻
Working
View GitHub Profile
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
@osama-raddad
osama-raddad / proguard-rules.pro
Created October 15, 2020 11:22 — forked from jemshit/proguard-rules.pro
Proguard rules for common Android libraries
# 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>;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.LinearSnapHelper;
import android.support.v7.widget.OrientationHelper;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.LayoutManager;
import android.view.Gravity;
import android.view.View;
@osama-raddad
osama-raddad / ApiModule.java
Created November 9, 2017 10:00 — forked from msangel/ApiModule.java
Retrofit 1 error handling behaviour in Retrofit 2.3.0
// Dagger 1 example
@Module(
complete = false,
library = true
)
public final class ApiModule {
@Provides
@Singleton
Retrofit provideRetrofit(Gson gson, Application app) {
return new Retrofit.Builder()
@osama-raddad
osama-raddad / Neat Emoticons
Created May 15, 2017 09:16 — forked from DeadlyBrad42/Neat Emoticons
Not that we needed all that for the trip, but once you get locked into a serious emoticon collection, the tendency is to push it as far as you can.
Neat Emoticons & Unicode Characters!
(•_• )
( •_•)
( •_•)>⌐■-■
(⌐■_■)
⌐■-■
⌐■-■
⌐■-■
@osama-raddad
osama-raddad / tools.md
Created April 27, 2017 09:46 — forked from geraldvillorente/tools.md
My Tools
  1. git
  2. geany
  3. letsencrypt
  4. docker
  5. vagrant
  6. meld
  7. git-sweep
  8. htop
  9. nano
  10. terminator
@osama-raddad
osama-raddad / chai-expect.md
Created March 8, 2017 15:41 — forked from patocallaghan/chai-expect.md
Chai Expect Assertion library examples. From http://chaijs.com/api/bdd/ #chai #javascript #expect

##Chai Expect

##Language Chains

  • to
  • be
  • been
  • is
  • that
  • and
  • have
@osama-raddad
osama-raddad / LangUtils.java
Created January 30, 2017 10:21 — forked from Nilzor/LangUtils.java
Java langUtils. Some HashMap and reflection stuff
public class LangUtils {
public static <K,V> ArrayList<V> getOrCreateArrayList(HashMap<K, ArrayList<V>> hashMap, K key) {
ArrayList<V> list = hashMap.get(key);
if (list == null) {
list = new ArrayList<V>();
hashMap.put(key, list);
}
return list;
}
@osama-raddad
osama-raddad / TwoWayBoundString.java
Created January 29, 2017 10:44 — forked from Nilzor/TwoWayBoundString.java
Tow-way data bound string, based on Blog by Fabio Colini
import android.databinding.BaseObservable;
import android.databinding.BindingAdapter;
import android.databinding.BindingConversion;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import java.io.Serializable;
@osama-raddad
osama-raddad / gist:30c2292037120ff4e4e0b81ba13427df
Created December 27, 2016 18:00 — forked from polbins/gist:437297ed7587c100e57d
Sample use of OkHttp + Retrofit Application Interceptor for Resending Requests w/ Refreshed Tokens
OkHttpClient okHttpClient = new OkHttpClient();
okHttpClient.interceptors().add(mRefreshAndRetryInterceptor);
mRestAdapter = new RestAdapter.Builder()
...
.setClient(new OkClient(okHttpClient))
.build();
private final Interceptor mRefreshAndRetryInterceptor = new Interceptor() {