Skip to content

Instantly share code, notes, and snippets.

Avatar

Ethan Hall ethankhall

  • Convoy
  • Seattle, WA
View GitHub Profile
View zsh.yaml
- template:
src: zshrc
dest: "$HOME/.zshrc"
- command:
exec: git clone --recursive https://github.com/ethankhall/prezto.git $HOME/.zprezto
- command:
exec: ln -s $HOME/.zprezto/runcoms/@it@ $HOME/.@it@
items:
View NomadTestMain.kt
import com.hashicorp.nomad.apimodel.EphemeralDisk
import com.hashicorp.nomad.apimodel.Job
import com.hashicorp.nomad.apimodel.Resources
import com.hashicorp.nomad.apimodel.RestartPolicy
import com.hashicorp.nomad.apimodel.Task
import com.hashicorp.nomad.apimodel.TaskGroup
import com.hashicorp.nomad.javasdk.NomadApiClient
import com.hashicorp.nomad.javasdk.NomadApiConfiguration
import org.apache.commons.lang.RandomStringUtils
import org.slf4j.Logger
View build.gradle
configurations {
groovy
}
dependencies {
groovy localGroovy()
}
project.tasks.create("generateExample", JavaExec) { task ->
def inputFile = file("input.groovy")
@ethankhall
ethankhall / upload.sh
Created Aug 16, 2016
Upload pypi to bintray
View upload.sh
NAME=$1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REPO=""
USERNAME=""
KEY=""
echo "Uploading $1 to bintray"
if jfrog bt package-show $USERNAME/$USERNAME/$NAME > /dev/null; then
echo "Package already exists, not creating"
@ethankhall
ethankhall / tree
Created Aug 11, 2016
{py}gradle Directory Structure
View tree
$ tree
├── build.gradle
├── gradlew
├── foo
│ ├── build.gradle
│ ├── setup.cfg
│ ├── setup.py
│ ├── src
│ │ └── foo
@ethankhall
ethankhall / setup.py
Created Aug 11, 2016
Example setup.py for {py}gradle
View setup.py
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 Aug 11, 2016
Sample build.gradle for {py}gradle
View build.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'
}
View build.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'
}
View flip.sh
echo
echo -en "( º_º) ┬─┬ \r"
sleep .5
echo -en " ( º_º) ┬─┬ \r"
sleep .5
echo -en " ( ºДº)┬─┬ \r"
sleep .5
echo -en " (╯'Д')╯︵⊏ \r"
sleep .5
echo -en " (╯'□')╯︵ ⊏ \r"
View binary-task-not-showing-source-sets.gradle
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 {}