Skip to content

Instantly share code, notes, and snippets.

@Piasy
Piasy / .gitignore
Created March 10, 2016 15:05
AndroidTDDBootStrap-Use-OkBuck
# buck & OkBuck
/buck-out/
/.buckd/
/.okbuck/
@Piasy
Piasy / build1.gradle
Created March 10, 2016 15:32
AndroidTDDBootStrap-Use-OkBuck-2
...
buildscript {
...
dependencies {
...
classpath "com.github.piasy:okbuck-gradle-plugin:1.0.0-beta8"
}
}
...
apply plugin: 'com.github.piasy.okbuck-gradle-plugin'
private static final String TAG = "RxScreenshotDetector";
private static final String EXTERNAL_CONTENT_URI_MATCHER =
MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString();
private static final String[] PROJECTION = new String[] {
MediaStore.Images.Media.DISPLAY_NAME, MediaStore.Images.Media.DATA,
MediaStore.Images.Media.DATE_ADDED
};
private static final String SORT_ORDER = MediaStore.Images.Media.DATE_ADDED + " DESC";
private static final long DEFAULT_DETECT_WINDOW_SECONDS = 10;
#!/bin/bash
checkExisting(){
echo "Checking if already existing device on file..."
while read fileLine; do
if [ "$line" = "$fileLine" ]; then
echo "[WARNING] Device already initialized on this system. Nothing to do here"
@Piasy
Piasy / AndroidManifest.xml
Created October 21, 2016 15:42
mockito connected Android test bug repro
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.piasy.mockitodexmakerbug">
<application
android:theme="@style/Theme.AppCompat"
>
<activity android:name=".MyActivity"/>
</application>
</manifest>
@Piasy
Piasy / ProducerTest.java
Last active October 25, 2016 10:41
Demonstrate ValueRequestOperator
import java.util.Random;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Test;
import rx.Emitter;
import rx.Observable;
import rx.Producer;
import rx.Subscriber;
import rx.Subscription;
@Piasy
Piasy / VSCodeSettings
Created June 14, 2020 09:37
VSCodeSettings
test
@Piasy
Piasy / jacoco.gradle
Created August 23, 2015 08:41
Android Gradle build script that create jacocoReport task for all sub projects, with some customization
/**
* List of modules that don't require Jacoco
*/
def ignoredByJacoco = [
'presentation'
]
/**
* module class dirs
* */
@Piasy
Piasy / android_use_static_webrtc.diff
Created September 11, 2019 09:03
A patch which disable using in-tree libc++ for WebRTC Android build.
From 9925be8afd008325875a0b131ac51f4353564ba6 Mon Sep 17 00:00:00 2001
From: Piasy <xz4215@gmail.com>
Date: Wed, 11 Sep 2019 16:37:19 +0800
Subject: [PATCH] Android: disable in-tree libc++
---
config/android/BUILD.gn | 38 +++++++++++++++++++++++++++++++++++---
config/c++/c++.gni | 2 +-
2 files changed, 36 insertions(+), 4 deletions(-)
@Piasy
Piasy / install_ffmpeg.sh
Last active April 14, 2024 05:40
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \