Skip to content

Instantly share code, notes, and snippets.

View mandrachek's full-sized avatar

Mark Andrachek mandrachek

View GitHub Profile
on run
end run
on idle
tell application "System Events"
if (get name of every application process) contains "Microsoft Error Reporting" then
tell application "System Events" to tell process "Microsoft Error Reporting"
activate
set box to checkbox "Restart Microsoft Lync" of window "Microsoft Error Reporting"
if value of box = 0 then
@mandrachek
mandrachek / SpoonDialogAction.java
Last active August 29, 2015 14:23
capture dialog
import android.support.test.espresso.UiController;
import android.support.test.espresso.ViewAction;
import android.view.View;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import static android.support.test.espresso.Espresso.onView;
public final class SpoonDialogAction implements ViewAction {
@mandrachek
mandrachek / gist:0a47a0d1e48aee860d6c
Created November 2, 2015 21:41
dynamic ext.betaDistributionApkFilePath
android {
splits {
abi {
enable true
reset()
include 'x86', 'armeabi', 'armeabi-v7a', 'mips', 'arm64-v8a'
universalApk true
}
}
@mandrachek
mandrachek / MultiDexJunitRunner
Last active August 22, 2016 09:25
AndroidJunitRunner that supports MultiDex
import android.os.Bundle;
import android.support.multidex.MultiDex;
import android.support.test.runner.AndroidJUnitRunner;
public class MultiDexJunitRunner extends AndroidJUnitRunner {
@Override
public void onCreate(Bundle arguments) {
MultiDex.install(getTargetContext());
super.onCreate(arguments);
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
import android.content.res.Configuration
import android.os.Bundle
import android.support.constraint.ConstraintSet
import android.support.v7.app.AppCompatActivity
import android.transition.ChangeBounds
import android.transition.TransitionManager
import kotlinx.android.synthetic.main.main_landscape.*
class MainActivity : AppCompatActivity() {
package okhttp3
import okhttp3.Cache
import okhttp3.internal.io.FileSystem
import okio.*
import java.io.*
import java.security.SecureRandom
import javax.crypto.Cipher
import javax.crypto.CipherInputStream
import javax.crypto.CipherOutputStream
package com.android.ide.common.vectordrawable
import java.awt.image.BufferedImage
import java.io.File
import java.io.InputStream
import javax.imageio.ImageIO
/**
* Converts a VectorDrawable to a BufferedImage.
* Please note that this has to live inside the com.android.ide.common.vectordrawable package so that