This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- You can change the parent around to whatever you normally use --> | |
<style name="DebugColors" parent="Theme.AppCompat"> | |
<!-- System colors --> | |
<item name="android:windowBackground">@color/__debugWindowBackground</item> | |
<item name="android:colorPressedHighlight">#FF4400</item> | |
<item name="android:colorLongPressedHighlight">#FF0044</item> | |
<item name="android:colorFocusedHighlight">#44FF00</item> | |
<item name="android:colorActivatedHighlight">#00FF44</item> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
# well, so I wrote my own script to do the simple job of converting package names. | |
# | |
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
# | |
# It'll run faster on a clean build because then there are fewer files to scan over. | |
# | |
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import be.tarsos.dsp.AudioEvent | |
import be.tarsos.dsp.io.jvm.AudioDispatcherFactory | |
import be.tarsos.dsp.pitch.PitchDetectionHandler | |
import be.tarsos.dsp.pitch.PitchDetectionResult | |
import be.tarsos.dsp.pitch.PitchProcessor | |
import be.tarsos.dsp.pitch.PitchProcessor.PitchEstimationAlgorithm | |
import java.awt.Robot | |
import java.awt.event.InputEvent | |
import java.util.concurrent.Executors | |
import java.util.concurrent.TimeUnit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This app collects no private data, period. Your data will not be used in any way, because we won't have it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Action1<Throwable> crashOnError() { | |
final Throwable checkpoint = new Throwable(); | |
return throwable -> { | |
StackTraceElement[] stackTrace = checkpoint.getStackTrace(); | |
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()` | |
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)", | |
element.getClassName(), | |
element.getMethodName(), | |
element.getFileName(), | |
element.getLineNumber()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun verifySerializedNameMatchesJsonName() { | |
// Reflections library | |
Reflections("com.foobar").getTypesAnnotatedWith(JsonClass::class.java) | |
.flatMap { clz -> | |
// FieldUtils is in Apache Commons | |
FieldUtils.getAllFieldsList(clz).filter { !Modifier.isStatic(it.modifiers) } | |
} | |
.forEach { field -> | |
val serializedNameAnnotation = field.declaredAnnotations.find { it is SerializedName } as? SerializedName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Follow the five numbered instructions for setting up Crashlytics | |
buildscript { | |
repositories { | |
maven { url 'http://repo1.maven.org/maven2' } | |
// 1. Add the Crashlytics Maven repository to your build script. | |
maven { url 'http://download.crashlytics.com/maven' } | |
} | |
dependencies { |
I hereby claim:
- I am dlew on github.
- I am danlew (https://keybase.io/danlew) on keybase.
- I have a public key ASD8v3oTeKIyAZP1WwjzP1Wxej0F_V6CqXZOdQ9A61iewAo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("unchecked") | |
public static <T extends View> T findView(Activity activity, int id) { | |
return (T) activity.findViewById(id); | |
} | |
@SuppressWarnings("unchecked") | |
public static <T extends View> T findView(View view, int id) { | |
return (T) view.findViewById(id); | |
} |
NewerOlder