Skip to content

Instantly share code, notes, and snippets.

View StevenACoffman's full-sized avatar

Steve Coffman StevenACoffman

View GitHub Profile
@StevenACoffman
StevenACoffman / notes-testing.md
Last active August 4, 2025 15:39
HTTP testing in Go

Goal: Less Badness

  • Enable Quality
  • Enable Maintenance
  • Enable Validation

Testing Terms

  • Stub - an object that provides predefined answers to method calls.
  • Mock - an object on which you set expectations.
  • Fake - an object with limited capabilities (for the purposes of testing), e.g. a fake web service.
@StevenACoffman
StevenACoffman / a-non-root-ssh-keys-in-kube.md
Last active July 19, 2025 14:31
SSH keys in kubernetes as non-root
# get your own login
query { 
  viewer { 
    login
  }
}

List the organizations for a user:

@StevenACoffman
StevenACoffman / careers.md
Last active March 3, 2025 18:48
Careers

Change jobs every two to three years.

  • The Carrot
    CLICK ME

    The worst kept secret is that employees are making less on average every year. There are millions of reasons for this, but we’re going to focus on one that we can control. Staying employed at the same company for over two years on average is going to make you earn less over 10 years by about 50% or more.

    Keep in mind that 50% is a conservative number at the lowest end of the spectrum. The longer you work, the greater the difference will become over your lifetime.

@StevenACoffman
StevenACoffman / main.go
Created May 19, 2021 00:59 — forked from salrashid123/main.go
Sample golang app that uses the Google CLoud Admin SDk to create a user and then add that user to a specific google group
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"golang.org/x/net/context"

Temporal and Watermill solve different problems, or solve problems differently. From a domain perspective, Temporal workflows implement policies and as a result they provide orchestration for the entire process. Nothing stops you from implementing workflows that span through different domains (bounded contexts) though, so if the process is well defined, you can implement it in a single workflow. That gives you the advantage of being able to remediate if any of the steps fail (eg. if the payment fails, the order shouldn't be sent to shipping).

That's not always the case though. Sometimes you need to provide integration points in the system that lets actors outside of a business process to react to events which is when Watermill comes into the picture.

Ultimately, the two can be combined very easily. For example, a Temporal activity can send an event to watermill, or a watermill event can start a new workflow.

As a rule

@StevenACoffman
StevenACoffman / go-error.md
Last active September 14, 2023 11:48
Errors in Go

This is my notes from a few articles:

Some error values are mostly just used for control flow. For example, "Access Denied", or "Authentication Required".

In my opinion, you should only add stack trace to an error which is potentially going to break your program. A logical error like we have seen in the authorization example does not need a track state. But since Wrap method can be used to ammend original error message which is also called as annotating an error, the choice is up to you.

The types of errors that would bubble up to be a 500 Internal Server Error generally require investigation by a developer. In these cases, a stacktrace (and ideally other contextual information) is incredibly valuable.

@StevenACoffman
StevenACoffman / GitCommitEmoji.md
Created December 17, 2020 15:44 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji