Skip to content

Instantly share code, notes, and snippets.

View alexander-mironov's full-sized avatar

Alexander Mironov alexander-mironov

View GitHub Profile
@alex-shpak
alex-shpak / Interceptor.java
Last active March 29, 2023 21:06
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 {
@Override
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
@simonbroggi
simonbroggi / TouchScriptInputModule.cs
Last active May 7, 2024 09:16
Input Module to use the new unity ui with multitouch from https://github.com/TouchScript
/**
* Input Module to use the new unity ui with multitouch from https://github.com/TouchScript
* Install TouchScript in your unity project, then add an EventSystem and replace the InputModules by this one.
*
*
* Basically modified TouchInputModule from
* https://bitbucket.org/Unity-Technologies/ui/src/5fc21bb4ecf4b40ff6630057edaa070252909b2e/UnityEngine.UI/EventSystem/InputModules/TouchInputModule.cs?at=4.6
* and changing ProcessTouchEvent to take events from TouchScript
*
* Got the TouchScript stuff from
@romannurik
romannurik / CharsPerLineActivity.java
Last active December 17, 2021 03:15
Demonstrates how to identify and avoid line-length issues with TextView. The measure, or characters per line, of a block of text plays a key role in how comfortable it is to read (sometimes referred to as readability). A widely accepted optimal range for a text block's measure is between 45 and 75 characters. This code demonstrates two phases of…
/*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software