Skip to content

Instantly share code, notes, and snippets.

@burntcookie90
burntcookie90 / google_music.scpt
Last active January 4, 2016 07:19 — forked from mayoff/gist:1138816
Applescript to launch google music, or bring it to foreground if it exists
tell application "Google Chrome"
activate
set theUrl to "https://play.google.com/music"
if (count every window) = 0 then
make new window
end if
set found to false
set theTabIndex to -1
@burntcookie90
burntcookie90 / javadoc.gradle
Created April 7, 2014 22:03
Javadoc Gradle Task
android.libraryVariants.all { variant ->
task("${variant.name}Javadoc", type: Javadoc) {
title = "$name $version API"
description "Generates Javadoc for $variant.name."
source = variant.javaCompile.source
ext.androidJar =
"${android.plugin.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
options.links("http://docs.oracle.com/javase/7/docs/api/");
@burntcookie90
burntcookie90 / proguard.cfg
Created April 8, 2014 18:42
Proguard for use with junit, gson and guava
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
float scale = getResources().getDisplayMetrics().density;
int dpAsPixels = (int) (sizeInDp*scale + 0.5f);
language: android
jdk: oraclejdk7
env:
matrix:
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
android:
components:
- build-tools-19.0.3
@burntcookie90
burntcookie90 / CheckableLinearLayout.java
Last active August 29, 2015 14:02
Checkable layout
public class CheckableLinearLayout extends LinearLayout implements Checkable {
private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked };
private boolean mChecked;
private OnCheckedChangeListener mOnCheckedChangeListener;
public CheckableLinearLayout(Context context) {
super(context, null);
}
public CheckableLinearLayout(Context context, AttributeSet attrs) {
@burntcookie90
burntcookie90 / card_bg.xml
Created June 6, 2014 18:08
Android Cards UI background
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle"
android:dither="true">
<corners android:radius="2dp"/>
<solid android:color="#dbdbdb" />
</shape>
</item>
@burntcookie90
burntcookie90 / build.gradle
Created June 24, 2014 20:06
basic build.gradle for a library project
apply plugin: 'android-library'
android {
compileSdkVersion 19
buildToolsVersion '19.1'
defaultConfig {
minSdkVersion 15
targetSdkVersion 19
versionCode 1
language: android
jdk: oraclejdk7
env:
matrix:
- ANDROID_TARGET=android-L ANDROID_ABI=armeabi-v7a
android:
components:
- build-tools-19.1
before_install:
# Install base Android SDK