Skip to content

Instantly share code, notes, and snippets.

🎯
Shooting Star

Kaede Akatsuki kaedea

🎯
Shooting Star
Block or report user

Report or block kaedea

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Dispatcher.java
/**
* Task dispatcher interface.
* Using {@linkplain Maker} to build instance in a simple way.
*
* @author kaede
* @version date 16/10/19
*/
public interface Dispatcher {
String TAG = "task.dispatcher";
@kaedea
kaedea / Latch.java
Created Sep 13, 2016
Synchronize helper class in TestCase.
View Latch.java
public class Latch {
volatile boolean isNotified;
public synchronized void tryNotify() {
isNotified = true;
notify();
}
public synchronized void tryWait(long millis) {
try {
@kaedea
kaedea / Locker.java
Created Sep 7, 2016
Java process-safe locker
View Locker.java
/**
* Multi-process lock
*
* @author kaede
* @version date 16/9/6
*/
class Locker {
public static final int EXPIRED_TIME = 30 * 60 * 1000; // 30 minutes
@kaedea
kaedea / android_h5_monitor.js
Last active Aug 31, 2016
JavaScript for monitoring Android WebView performance.
View android_h5_monitor.js
window.addEventListener('DOMContentLoaded',
function() {
prompt('domc:' + window.app.getCurrentTime());
})
window.addEventListener('load',
function() {
prompt('load:' + window.app.getCurrentTime());
})
View MediaCodecInfoTest.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void testMediaCodecInfo() {
// list media codec
int numCodec = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodec; i++) {
MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
Log.i(TAG, "[kaede][testMediaCodecInfo]" +
"=================================== " + codecInfo.getName() + " ===================================");
boolean isEncoder = codecInfo.isEncoder();
Log.d(TAG, "isEncoder = " + isEncoder);
You can’t perform that action at this time.