Skip to content

Instantly share code, notes, and snippets.

Ethan Hall ethankhall

  • Convoy
  • Seattle, WA
View GitHub Profile
@ethankhall
ethankhall / Debug out of the issue
Created Oct 8, 2012
Error report for Android Gradle support - Basic
View Debug out of the issue
20:51:19.786 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@1aac087b, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@1460d0eb, org.gradle.logging.internal.JavaUtilLoggingConfigurer@6033fec0]
20:51:20.807 [DEBUG] [org.gradle.logging.internal.DefaultLoggingConfigurer] Finished configuring with level: DEBUG, configurers: [org.gradle.logging.internal.OutputEventRenderer@1aac087b, org.gradle.logging.internal.logback.LogbackLoggingConfigurer@1460d0eb, org.gradle.logging.internal.JavaUtilLoggingConfigurer@6033fec0]
20:51:20.813 [INFO] [org.gradle.BuildLogger] Starting Build
20:51:20.814 [DEBUG] [org.gradle.BuildLogger] Gradle user home: /home/ethan/.gradle
20:51:20.816 [DEBUG] [org.gradle.BuildLogger] Current dir: /home/ethan/IdeaProjects/PinballTracker
20:51:20.818 [DEBUG] [org.gradle.BuildLogger] Settings file: null
20:51:20.820 [DEBUG] [org.gradle.BuildLogger] Build file: null
20:51:
@ethankhall
ethankhall / MagicalLand.java
Last active Dec 13, 2015
Magical Java Puzzle: “Pat The Unicorns”
View MagicalLand.java
package io.ehdev;
public class MagicalLand {
public static void main(String[] args) {
for (int i = 0; i < (Math.random() * 500) + 2; i++) {
if (Unicorn.pat()) {
System.out.println("UNICORN #1: PAT THIS UNICORN ONCE");
}
}
@ethankhall
ethankhall / MainActivity.java
Created Apr 7, 2013
Rotation support for SherlockFragmentActivity and SherlockFragment
View MainActivity.java
public class RootActivity extends SherlockFragmentActivity implements ActionBar.TabListener {
static private Fragment listOfFragments[];
private static final String TAG = RootActivity.class.getName();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
@ethankhall
ethankhall / build.gradle
Last active Dec 16, 2015
Using Gradle with the Android plugin to add a JNI project to the APK.
View build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.3'
}
}
sourceCompatibility = JavaVersion.VERSION_1_6
@ethankhall
ethankhall / MyView.java
Created May 4, 2013
Half Circle List View
View MyView.java
package io.ehdev.android.example.wheel.layout;
import android.content.Context;
import android.graphics.Canvas;
import android.util.DisplayMetrics;
import android.widget.TextView;
public class MyView extends TextView {
private static final int MAX_INDENT = 300;
View HalfCircleListView.java
import android.widget.ListView;
import android.widget.AbsListView;
import android.content.Context;
public class HalfCircleListView extends ListView implements AbsListView.OnScrollListener {
public HalfCircleListView(Context context) {
super(context);
setOnScrollListener(this);
}
@ethankhall
ethankhall / ivyConverter.groovy
Created Nov 8, 2013
Ivy to Gradle dependency converter
View ivyConverter.groovy
println("dependencies {")
def ivyModule = new XmlParser().parse(new File('ivy.xml'))
ivyModule.dependencies.dependency.each {
def scope = it.@conf?.contains("test") ? "testCompile" : "compile"
println("\t$scope '${it.@org}:${it.@name}:${it.@rev}'")
}
println("}")
@ethankhall
ethankhall / gradle.properties
Created Nov 21, 2013
Gradle properties file
View gradle.properties
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.daemon=true
View build.gradle
apply plugin: 'java'
apply plugin: 'idea'
def imlName = name + (hasProperty('generate12') ? '.ij12' : '.ij13')
idea {
module {
name = imlName
}
}
@ethankhall
ethankhall / Application.groovy
Last active Jun 9, 2016
Auth0 Spring Boot Java Config
View Application.groovy
package com.example
import groovy.util.logging.Slf4j
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Import
import org.springframework.web.servlet.config.annotation.EnableWebMvc
You can’t perform that action at this time.