Skip to content

Instantly share code, notes, and snippets.

@filipproch
filipproch / build.gradle
Last active May 13, 2020 22:23
With Archon installed, this way you can debug your Android app without slow bad emulator
task runChromeAppDebug(type: Exec) {
executable "bash"
args "--login", "-c", "google-chrome --load-and-launch-app=${projectDir}/${android.defaultConfig.applicationId}.android"
}
task copyChromeAppDebug(type: Copy) {
from "${buildDir}/outputs/apk/${project.name}-debug.apk"
into "${projectDir}/${android.defaultConfig.applicationId}.android/vendor/chromium/crx/"
}
@egslava
egslava / WrapContentHeightViewPager.java
Created August 12, 2014 12:28
Wrap content height ViewPager (Android)
package org.cnii.layoutloader.ui;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
/**
* Special thanks to Daniel López Lacalle for his response
* (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791)
@staltz
staltz / introrx.md
Last active May 12, 2025 23:22
The introduction to Reactive Programming you've been missing
@dodyg
dodyg / gist:5823184
Last active May 7, 2025 20:27
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@arriolac
arriolac / TopCropImageView.java
Last active March 6, 2025 07:32
Custom Android ImageView for top-crop scaling of the contained drawable.
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.