This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
repositories { | |
mavenLocal() | |
maven { | |
url 'https://plugins.gradle.org/m2/' | |
} | |
maven { | |
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Queue; | |
import java.util.concurrent.atomic.*; | |
import rx.*; | |
import rx.Observable.Operator; | |
import rx.exceptions.MissingBackpressureException; | |
import rx.internal.operators.*; | |
import rx.internal.util.*; | |
import rx.internal.util.atomic.SpscAtomicArrayQueue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.app.Application; | |
import android.content.Context; | |
import android.content.ContextWrapper; | |
import android.os.Bundle; | |
import android.os.Looper; | |
import android.os.MessageQueue; | |
import android.util.Log; | |
import android.view.View; | |
import android.view.ViewTreeObserver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Here's a trick to get XML injected into the APK. | |
// Be careful not to merge-conflict with existing parameters, as this occurs after the mergeResources step, and the behavior is likely undefined. | |
// was added to app/build.gradle after applying android plugin. | |
android.applicationVariants.all { variant -> | |
// Supports both 0.12.+ and 1.+ of Android gradle plugin by getting all processResourceTasks: | |
def tasks = [] | |
// Multidex has multiple process resource tasks | |
if (variant.hasProperty('outputs')) { | |
for (output in variant.outputs) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
import java.util.concurrent.TimeUnit; | |
import rx.Observable; | |
import rx.Subscriber; | |
import rx.schedulers.Schedulers; | |
public class DebounceBuffer { | |
public static void main(String args[]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toCamelCase(String string) { | |
String result = "" | |
string.findAll("[^\\W]+") { String word -> | |
result += word.capitalize() | |
} | |
return result | |
} | |
afterEvaluate { project -> | |
Configuration runtimeConfiguration = project.configurations.getByName('compile') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dex-method-count() { | |
cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
} | |
function dex-method-count-by-package() { | |
dir=$(mktemp -d -t dex) | |
baksmali $1 -o $dir | |
for pkg in `find $dir/* -type d`; do | |
smali $pkg -o $pkg/classes.dex | |
count=$(dex-method-count $pkg/classes.dex) |