Skip to content

Instantly share code, notes, and snippets.

View ArthurSav's full-sized avatar
😎

Arthur ArthurSav

😎
View GitHub Profile
@ArthurSav
ArthurSav / FrameworkFinder.kt
Created June 15, 2023 14:23
Detects UI Framework (React Native, Flutter, SwiftUI) used in a simulator build.
import java.io.BufferedReader
import java.io.File
import java.io.InputStreamReader
import kotlin.concurrent.thread
// This script will determine the framework used to build an iOS app.
// Compile: kotlinc FrameworkFinder.kt -include-runtime -d FrameworkFinder.jar
// Usage: java -jar FrameworkFinder.jar <path-to-app-bundle>
// Example: java -jar FrameworkFinder.jar /Users/username/Desktop/MyApp.app
@ArthurSav
ArthurSav / WrapGridLayoutManager.java
Created September 11, 2015 14:45
GridLayoutManager with working wrap_content.
package com.inperson.android.utils.leastview;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
public class WrappableGridLayoutManager extends GridLayoutManager {
@ArthurSav
ArthurSav / build.gradle
Created February 15, 2018 18:05
Increment version number and update version name on your android builds automatically. Version name is generated by the last tag on your git commits.
apply from: 'versions.gradle'
android {
defaultConfig {
versionName VERSION_NAME
versionCode VERSION_CODE.toInteger()
}
buildTypes {
release {}
@ArthurSav
ArthurSav / HostSelectionInterceptor.java
Created May 16, 2016 21:26 — forked from swankjesse/HostSelectionInterceptor.java
This OkHttp application interceptor will replace the destination hostname in the request URL.
import java.io.IOException;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
/** An interceptor that allows runtime changes to the URL hostname. */
public final class HostSelectionInterceptor implements Interceptor {
private volatile String host;