Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
@StevenACoffman
StevenACoffman / checkIsHeadPushed.go
Created August 20, 2019 19:01
Check if git HEAD pushed to origin/master?
///usr/bin/env go run "$0" "$@" ; exit "$?"
package main
import (
"fmt"
"os"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing"
)
@StevenACoffman
StevenACoffman / WhyGo.md
Last active February 6, 2020 22:37
Why Golang?
@StevenACoffman
StevenACoffman / GolangSeparatingUnitTestsAndIntegrationTests.md
Last active November 6, 2019 17:50
Separating unit tests and integration tests in Go

From this stackoverflow answer:

@Ainar-G suggests several great patterns to separate tests.

[This set of Go practices from SoundCloud][1] recommends using build tags ([described in the "Build Constraints" section of the build package][2]) to select which tests to run:

Write an integration_test.go, and give it a build tag of integration. Define (global) flags for things like service addresses and connect strings, and use them in your tests.

// +build integration

>

@StevenACoffman
StevenACoffman / Dockerfile
Created August 1, 2019 20:53 — forked from pgilad/Dockerfile
Minimal Spring Boot 2 on Docker Alpine with Java 11 (Using Jigsaw modules)
FROM alpine:3.8 AS builder
WORKDIR /opt
ARG JDK_TAR=openjdk-11+28_linux-x64-musl_bin.tar.gz
ARG JDK_DOWNLOAD_PREFIX=https://download.java.net/java/early_access/alpine/28/binaries
RUN wget -q "$JDK_DOWNLOAD_PREFIX/$JDK_TAR" && \
wget -q "$JDK_DOWNLOAD_PREFIX/$JDK_TAR.sha256"
RUN cat $JDK_TAR.sha256 | xargs -I{} echo "{} $JDK_TAR" | sha256sum -c - && \
@StevenACoffman
StevenACoffman / deploy-create-react-app-with-nginx.md
Created June 14, 2019 17:52 — forked from huangzhuolin/deploy-create-react-app-with-nginx.md
[Deploy create-react-app(react-router) with nginx] #react #nginx

Create-react-app

Create React apps with no build configuration.

Thanks to create-react-app. It's saves a lot of my time. I remember several months ago I had to setup a lot just for a react app, webpack, babel, test environment and so on... Fortunately, everything becomes easy now. Though you have many choices of start boiler plate, you worth trying this.

React router

If you are build a SPA with react, you probably use react-router.

Automated Infrastructure

This workshop will provide hands on experience on setting up and running an AWS Kubernetes cluster using EKS. We will use gitops, and explore kubernetes tools to make the cluster self-driving, with automated management and remedy of common cluster level problems. To achieve this, we will use eksctl, cluster-autoscaler, kube-prometheus (prometheus operator), node-problem-detector, draino, and node-local-dns-cache.

Intended audience

This workshop is intended to appeal primarily to four types of people:

  1. Application developers looking to get an AWS kubernetes cluster to experiment without a lot of infrastructure knowledge
  2. AWS DevOps people without a lot of kubernetes experience
  3. Kubernetes DevOps people without a lot of AWS experience
  4. Full-stack, Full-cycle developers in small or large teams.
@StevenACoffman
StevenACoffman / README.md
Created May 10, 2019 18:58 — forked from andrewodri/README.md
Create and Validate an ACM Certificate

This script performs the following actions:

  1. Creates a TLS certificate in ACM
  2. Upserts a validation CNAME record in Route 53
  3. Waits for the validation CNAME record to complete/update
  4. Waits for the certificate to validate and issue
  5. Outputs a description of the certificate

This obviously assumes that your domain's DNS is hosted on Route 53. It also uses the AWS credentials and region for the environment it is executed in.

@StevenACoffman
StevenACoffman / axios-dev-interceptors.js
Created April 2, 2019 18:12
axios logger (Interceptors)
// axios development only interceptors
// https://github.com/mzabriskie/axios#interceptors
/**
* Strip baseURL from URL
*
* @param config Object
* @returns String
*/
function getUrl(config) {