Skip to content

Instantly share code, notes, and snippets.

@qihnus
qihnus / vd.py
Last active December 13, 2020 12:42
List video durations on a Mac
#!/usr/bin/env python
import os
import sys
import glob
from QTKit import QTMovie
TOTAL_DURATION = 0
def format_duration(duration):
@qihnus
qihnus / textwatcher.py
Created February 25, 2012 18:18
Dectects text change in an EditText. Concept prototype for Android functional testing.
################################################################################
#
# Requirements:
# * pexpect (http://www.noah.org/wiki/Pexpect)
# * Java SDK is on the PATH
#
# Steps:
# 1. Start target activity on a device or emulator
# 2. Start DDMS, click on the package name of the started activity from the
# devices & processes window on the left, the rightmost column should now
@qihnus
qihnus / RecorderService.java
Created February 25, 2012 17:23
a minimalist example of Android accessibility service
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;
public class RecorderService extends AccessibilityService {
static final String TAG = "RecorderService";
private String getEventType(AccessibilityEvent event) {