Skip to content

Instantly share code, notes, and snippets.

View Aexyn's full-sized avatar
🤙
I may be slow to respond.

Aman Talwar Aexyn

🤙
I may be slow to respond.
View GitHub Profile
@Aexyn
Aexyn / gist:2288ed3048a946f2b717d58678e3c82a
Created March 7, 2017 11:46 — forked from Datoh/gist:44ecdaa49e50bea0a0c7
Android: How to kill the monkey
adb shell ps | awk '/com\.android\.commands\.monkey/ { system("adb shell kill " $2) }'
@Aexyn
Aexyn / gist:e6a76b2065d443aa8c64
Created December 29, 2015 05:52 — forked from JakeWharton/gist:f50f3b4d87e57d8e96e9
Rise and Shine™, unlock and wake up your device automatically when you deploy from the IDE. Put this somewhere in your `src/debug/` code and run it when the application or main activity starts. Apache 2.
/**
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
*/
public static void riseAndShine(Activity activity) {
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED);
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =
@Aexyn
Aexyn / BlurTransform.java
Created November 4, 2014 04:53
Optimized Blur with Picasso
import android.content.Context;
import android.graphics.Bitmap;
import android.support.v8.renderscript.Allocation;
import android.support.v8.renderscript.Element;
import android.support.v8.renderscript.RenderScript;
import android.support.v8.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
import android.content.Context;
import android.graphics.Bitmap;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;
import com.squareup.picasso.Transformation;
public class BlurTransform implements Transformation {