Skip to content

Instantly share code, notes, and snippets.

Working from home

Akshay Sharma akshay2211

Working from home
View GitHub Profile
View gist:2686e44f56634880465e8630ac5f8342
# sudo su and run the following
sudo aptitude update
# install all dependencies
sudo aptitude -y install \
python-pip \
python2.7-dev \
libssl-dev \
libcurl4-openssl-dev \
akshay2211 /
Created September 5, 2017 14:08 — forked from alex-shpak/
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON