Skip to content

Instantly share code, notes, and snippets.

public class PinCircle extends View {
private Paint paint;
private float strokeWidth;
public PinCircle(Context context) {
this(context, null);
}
@mattlogan
mattlogan / gist:918f75597dd50a20d936
Created February 26, 2015 22:30
Change image color
convert image.png -fuzz 50% -opaque black -fill white imageout.png
adb shell screenrecord /sdcard/blah_blah.mp4
convert image.png -channel R -evaluate set 30% -channel G -evaluate set 0% -channel B -evaluate set 100% image2.png
@mattlogan
mattlogan / disable-animations.sh
Created November 4, 2014 04:42
bash script to disable animations on an emulator
adb shell "
sqlite3 /data/data/com.android.providers.settings/databases/settings.db \"
update global set value='0.0' where name='window_animation_scale';
update global set value='0.0' where name='transition_animation_scale';
update global set value='0.0' where name='animator_duration_scale';
\"
"
import numpy as np
import matplotlib.pyplot as plt
# Load the text file
# This gives us an Nx4 matrix with columns: t, left, t, right
data = np.loadtxt("jeremih.txt")
print('Num samples: ' + str(len(data)))
# Make Nx2 matrix with columns: t, mean(left, right)
amp_vs_time = [[row[0], np.mean(row[1], row[3])] for row in data]