Skip to content

Instantly share code, notes, and snippets.

View ethankhall's full-sized avatar

Ethan Hall ethankhall

  • Gusto
  • Seattle, WA
View GitHub Profile
@ethankhall
ethankhall / setup.py
Created August 11, 2016 22:49
Example setup.py for {py}gradle
from setuptools.dist import Distribution
import os
class GradleDistribution(Distribution, object):
"""The Python to Gradle bridge."""
#: The name of the requirements file generated by pygradle.
PINNED_TXT = 'pinned.txt'
@ethankhall
ethankhall / build.gradle
Created August 11, 2016 22:47
Sample build.gradle for {py}gradle
apply plugin: 'python-sdist'
dependencies {
python 'pypi:Werkzeug:0.7',
python 'pypi:Jinja2:2.4',
python 'pypi:itsdangerous:0.21',
python 'pypi:click:2.0'
}
apply plugin: 'python-sdist'
dependencies {
python 'pypi:Werkzeug:0.7',
python 'pypi:Jinja2:2.4',
python 'pypi:itsdangerous:0.21',
python 'pypi:click:2.0'
}
@ethankhall
ethankhall / flip.sh
Created June 17, 2016 23:35
Flip ascii
echo
echo -en "( º_º) ┬─┬ \r"
sleep .5
echo -en " ( º_º) ┬─┬ \r"
sleep .5
echo -en " ( ºДº)┬─┬ \r"
sleep .5
echo -en " (╯'Д')╯︵⊏ \r"
sleep .5
echo -en " (╯'□')╯︵ ⊏ \r"
@ethankhall
ethankhall / Application.groovy
Last active June 9, 2016 17:50
Auth0 Spring Boot Java Config
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
import org.gradle.platform.*
interface CustomLanguageSourceSet extends LanguageSourceSet {}
interface SampleComponent extends ComponentSpec {}
interface SampleBinary extends BinarySpec {}
class DefaultCustomLanguageSourceSet extends BaseLanguageSourceSet implements CustomLanguageSourceSet {}
class DefaultSampleBinary extends BaseBinarySpec implements SampleBinary {}
class DefaultSampleComponent extends BaseComponentSpec implements SampleComponent {}
apply plugin: 'java'
apply plugin: 'idea'
def imlName = name + (hasProperty('generate12') ? '.ij12' : '.ij13')
idea {
module {
name = imlName
}
}
@ethankhall
ethankhall / gradle.properties
Created November 21, 2013 03:48
Gradle properties file
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.daemon=true
@ethankhall
ethankhall / build.gradle
Last active December 16, 2015 17:29
Using Gradle with the Android plugin to add a JNI project to the APK.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.3'
}
}
sourceCompatibility = JavaVersion.VERSION_1_6
@ethankhall
ethankhall / MainActivity.java
Created April 7, 2013 14:03
Rotation support for SherlockFragmentActivity and SherlockFragment
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) {