Skip to content

Instantly share code, notes, and snippets.

Steve Coffman StevenACoffman

  • Khan Academy
  • Ann Arbor, MI
Block or report user

Report or block StevenACoffman

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
@StevenACoffman
StevenACoffman / awesome-mage-magefile.md
Last active Dec 8, 2019
Awesome Mage and Magefiles
View awesome-mage-magefile.md
View locking-go-tools.md

If you've ever dealt with a team where different people had different versions of linters installed, you'll quickly realize that you should also lock your tools.

Before Go 1.13

Before Go 1.13 the recommended solution was to use tools.go file like this:

// +build tools

package tools

import (
View distributed-monolith-vs-microservices.md

From You're not actually building microservices

So, are you building microservices? Take a look at a few of these symptoms, and decide for yourself:

  • A change to one microservice often requires changes to other microservices
  • Deploying one microservice requires other microservices to be deployed at the same time
  • Your microservices are overly chatty
  • The same developers work across a large number of microservices
  • Many of your microservices share a datastore
  • Your microservices share a lot of the same code or models
View Go-Khantest.md

Khan Go Contest

We have a s3cr3t repository (ok, you can probably find it, but don't peek) that we will announce right before the contest start. It's some of the exercises that were literally and liberally stolen from literally and liberally stolen from the Exercism.io Go track.

Fork this repo, solve the exercises, and submit a pull request TO THAT REPO, NOT EXERCISM/GO for judging with the description containing your personal Tally (see rubric). No more commits after the time limit, but you can fuss with your Pull Request more after the time is up (like counting your score).

Please notify the judges in Slack the #go-contest channel which one, if any of your fully 100% passing solutions, should be considered for Special Awards:

  • Greased Lightning Performance Award - for exercises with benchmarks showing that you made yours go so dang fast
  • Elegant Étude Award - for exceptional cleverness, radical simplicity, and amazing aesthetics to your solutions.
@StevenACoffman
StevenACoffman / gokitlogrus.go
Last active Oct 29, 2019 — forked from bdimcheff/gokitlogrus.go
gokit -> logrus adapter
View gokitlogrus.go
package log
import (
"fmt"
gokitlog "github.com/go-kit/kit/log"
"github.com/sirupsen/logrus"
stackdriver "github.com/icco/logrus-stackdriver-formatter"
)
@StevenACoffman
StevenACoffman / echo_zap.go
Created Oct 26, 2019 — forked from ndrewnee/echo_zap.go
ZapLogger is an example of echo middleware that logs requests using logger "zap"
View echo_zap.go
package echomw
import (
"time"
"github.com/labstack/echo"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
@StevenACoffman
StevenACoffman / timeout_and_tick.go
Created Oct 25, 2019 — forked from ngauthier/timeout_and_tick.go
Golang timeout and tick loop
View timeout_and_tick.go
// keepDoingSomething will keep trying to doSomething() until either
// we get a result from doSomething() or the timeout expires
func keepDoingSomething() (bool, error) {
timeout := time.After(5 * time.Second)
tick := time.Tick(500 * time.Millisecond)
// Keep trying until we're timed out or got a result or got an error
for {
select {
// Got a timeout! fail with a timeout error
case <-timeout:
View git-fork-workflow.md

Git Fork Workflow Tips

From Apache Arrow Git Tips I’m used to working with git merge and this has made life difficult for me when working with Apache Arrow because it doesn’t use a merge model and pull request branches often need to rebased against master and force pushed.

There are numerous ways to work in this model but this article documents the approach I use, based on some guidance I was given on one of my PRs. I’m documenting this for my own benefit but hopefully it helps others too.

Creating a Fork

When you first fork the repo, you need to set up the upstream apache git repo as a remote. I prefer to name this remote apache rather than upstream since it is more explicit, especially if I add other remotes (such as other contributors forks).

@StevenACoffman
StevenACoffman / goGetPrivate.md
Last active Oct 18, 2019 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
View goGetPrivate.md

Set GOPRIVATE to match your github organization

Cloning the repo using one of the below techniques should correctly but you may still getting an unrecognized import error.

As it stands for Go v1.13, I found in the doc that we should use the GOPRIVATE variable like so:

GOPRIVATE=github.com/ORGANISATION_OR_USER_NAME go get -u -f github.com/ORGANISATION_OR_USER_NAME/REPO_NAME

The 'go env -w' command (see 'go help env') can be used to set these variables for future go command invocations.

How to go get private repos using SSH key auth instead of password auth.

You can’t perform that action at this time.