Skip to content

Instantly share code, notes, and snippets.

William Hayes wshayes

Block or report user

Report or block wshayes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
wshayes /
Last active May 15, 2019
[FastAPI Single File Demo] Example fastapi single file testable example #fastapi
import logging
from fastapi import FastAPI
from starlette.responses import RedirectResponse
from starlette.testclient import TestClient
logger = logging.getLogger(__name__)
app = FastAPI()
wshayes /
Created May 13, 2019
Example for fastapi/sqlalchemy
# From @euri10 --
import asyncio
import pytest
from sqlalchemy import create_engine
from sqlalchemy_utils import create_database, database_exists, drop_database
from starlette.config import environ
from starlette.testclient import TestClient
wshayes /
Created Apr 24, 2019
Running docker servers in pytest
# Example of code to startup docker containers for use in the tests
# pip install pytest-docker-tools
from pytest_docker_tools import container, fetch
arangodb_image = fetch(repository="arangodb:3.4")
elasticsearch_image = fetch(repository="elasticsearch:6.7.1")
arangodb_session = container(
wshayes / .bumpversion.cfg
Last active Feb 14, 2019
Bumpversion configuration
View .bumpversion.cfg
current_version = 0.0.0
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+)(?P<build>\d+))?
serialize =

Concourse CI Badge notes

Job Badge


Example Job Badge

The project has a Concourse CI pipeline consisting of one job.

The pipeline is (same name as the project, a simple naming scheme), and the job’s name is check-dns.

wshayes / ExampleDataSetArray.json
Created Jan 30, 2018
Example JSON and YAML for a Medium article
View ExampleDataSetArray.json
"key": "value1"
"key": "value2"
wshayes / Dockerfile
Created Sep 8, 2017
Keycloak Docker setup
View Dockerfile
FROM jboss/keycloak-postgres:2.3.0.Final
ADD enableProxy.xsl /opt/jboss/keycloak/
RUN java -jar /usr/share/java/saxon.jar \
-s:/opt/jboss/keycloak/standalone/configuration/standalone.xml \
-xsl:/opt/jboss/keycloak/enableProxy.xsl \
-o:/opt/jboss/keycloak/standalone/configuration/standalone.xml; \
java -jar /usr/share/java/saxon.jar \
-s:/opt/jboss/keycloak/standalone/configuration/standalone-ha.xml \
-xsl:/opt/jboss/keycloak/enableProxy.xsl \
wshayes /
Created Jul 5, 2017 — forked from balloob/
CLA for Apache 2.0 license

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the Apache 2.0 license; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the Apache 2.0 license; or

wshayes / Dockerfile-es
Last active Feb 9, 2019
Elasticsearch and Kibana using docker-compose (v3)
View Dockerfile-es
mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \
mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \
/usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack
wshayes / countries.js
Created Mar 23, 2017
ViewEngineHooks Aurelia example
View countries.js
// Here's an example from Rob Eisenberg
// filename: resources/data/countries.js
import {viewEngineHooks} from 'aurelia-templating';
let countries = [
{ abbreviation: "AF", name: "Afghanistan" },
{ abbreviation: "AL", name: "Albania" },
{ abbreviation: "DZ", name: "Algeria" },
You can’t perform that action at this time.