To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "time" | |
| ) | |
| var urls = []string{ | |
| "https://splice.com/", |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
| // haversin(θ) function | |
| func hsin(theta float64) float64 { | |
| return math.Pow(math.Sin(theta/2), 2) | |
| } | |
| // Distance function returns the distance (in meters) between two points of | |
| // a given longitude and latitude relatively accurately (using a spherical | |
| // approximation of the Earth) through the Haversin Distance Formula for | |
| // great arc distance on a sphere with accuracy for small distances | |
| // |
This script is no longer required with Docker for Mac which includes an option to run Docker at startup and doesn't use docker-machine to administer the local Docker engine.
docker-machine create --driver virtualbox default (this is the default with Docker toolkit).| package bigcache | |
| import ( | |
| "encoding/binary" | |
| "testing" | |
| "time" | |
| "github.com/allegro/bigcache" | |
| "github.com/coocood/freecache" | |
| ) |
| sudo apt install ruby ruby-dev | |
| sudo gem install travis | |
| # install path: /var/lib/gems/ |
| // Package deepcopy provides a function for deep copying map[string]interface{} | |
| // values. Inspired by the StackOverflow answer at: | |
| // http://stackoverflow.com/a/28579297/1366283 | |
| // | |
| // Uses the golang.org/pkg/encoding/gob package to do this and therefore has the | |
| // same caveats. | |
| // See: https://blog.golang.org/gobs-of-data | |
| // See: https://golang.org/pkg/encoding/gob/ | |
| package deepcopy |
在我之前的博文中,我描述了我是如何在容器中使用进程管理器的,并做了一些展开。但我还是觉得有必要针对 Laurent Bercot 开发的 S6 做更详尽的说明。
什么用 S6 而不是 Supervisor?
Here's the simplest example showing how to do functional options in Golang.
They're a great way to enable users to set options and ease adding new options later.
package main
import (
"flag"
"fmt"