Skip to content

Instantly share code, notes, and snippets.

@robert-dare
robert-dare / go-worker.go
Created September 19, 2020 02:07 — forked from System-Glitch/go-worker.go
A resilient Go worker
package main
// This is an example of a resilient worker program written in Go.
//
// This program will run a worker, wait 5 seconds, and run it again.
// It exits when SIGINT or SIGTERM is received, while ensuring any ongoing work
// is finished before exiting.
//
// Unexpected panics are also handled: program won't crash if the worker panics.
// However, panics in goroutines started by the worker won't be handled and have
@robert-dare
robert-dare / main.go
Created January 8, 2018 20:08 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@robert-dare
robert-dare / gist:4401a2445c6a561a375b
Created February 19, 2016 16:56
cf push 504 failure
enki:cf-apps robert$ cd cf-env/
RVM used your Gemfile for selecting Ruby, it is all fine - Heroku does that too,
you can ignore these warnings with 'rvm rvmrc warning ignore /Users/robert/bosh-aws/cf-apps/cf-env/Gemfile'.
To ignore the warning for all files run 'rvm rvmrc warning ignore allGemfiles'.
ruby-2.1.7 is not installed.
To install do: 'rvm install ruby-2.1.7'
enki:cf-env robert$ cf push
Using manifest file /Users/robert/bosh-aws/cf-apps/cf-env/manifest.yml
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'