Skip to content

Instantly share code, notes, and snippets.

@qihnus
qihnus / vd.py
Last active Oct 7, 2015
List video durations on a Mac
View vd.py
#!/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 Feb 25, 2012
Dectects text change in an EditText. Concept prototype for Android functional testing.
View textwatcher.py
################################################################################
#
# 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 Feb 25, 2012
a minimalist example of Android accessibility service
View RecorderService.java
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) {
You can’t perform that action at this time.