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
@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()
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.js"></script>
<title>JS Bin</title>
</head>
<body>
@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() {
OkHttpClient client = new OkHttpClient();
Proxy proxy = new Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved("192.168.1.105", 8081);
client.setProxy(proxy);
@osama-raddad
osama-raddad / README.md
Created May 18, 2016 14:25 — forked from polbins/README.md
Android Response Caching using Retrofit 1.9 + OkHttp 2.2

Android REST Controller with Cache-Control

Android REST Controller with Simple Cache Control Headers using Retrofit 1.9.0 + OkHttp 2.2.0