Skip to content

Instantly share code, notes, and snippets.

@r2d4
r2d4 / Makefile
Created February 8, 2018 05:44
wut
$(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(GO_FILES) $(BUILD_DIR)
GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=1 go build -ldflags $(GO_LDFLAGS) -o $@ $(BUILD_PACKAGE)
%.sha256: %
shasum -a 256 $< &> $@
@r2d4
r2d4 / version.go
Created February 8, 2018 05:34
github.com/r2d4/go-bitcoin/pkg/miner/version
package version
var version = "v0.0.0-unset"
func GetVersion() string {
return version
}
@r2d4
r2d4 / Makefile
Last active February 8, 2018 05:40
Makefile Part 1: Variables
ORG := github.com/r2d4
PROJECT := go-bitcoin
VERSION ?= v0.0.1
BUILD_PACKAGE = $(REPOPATH)/cmd/example
GO_LDFLAGS := "-X $(REPOPATH)/pkg/example/version.version=$(VERSION)"
SUPPORTED_PLATFORMS := linux-arm darwin-amd64 windows-amd64.exe
ORG := github.com/r2d4
PROJECT := example
VERSION ?= v0.0.1
GOOS ?= $(shell go env GOOS)
GOARCH = amd64
BUILD_DIR ?= ./out
REPOPATH ?= $(ORG)/$(PROJECT)
RELEASE_BUCKET ?= $(PROJECT)
SUPPORTED_PLATFORMS := linux-$(GOARCH) darwin-$(GOARCH) windows-$(GOARCH).exe

Keybase proof

I hereby claim:

  • I am r2d4 on github.
  • I am msr (https://keybase.io/msr) on keybase.
  • I have a public key ASC4tQr4Ytb5Bv0LTFelbHHy3W51oFPfSUZ7ct3mITR-8wo

To claim this, I am signing this object:

#add to your ~/.bashrc
#usage $git_checkout_date 2015-8-26
git_checkout_date()
{
git checkout `git rev-list -n 1 --before="$1" master`
}
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
files: {
src: ['build/js/**/*.js', '!build/js/lib/**/*.js'],
expand: true
}
},
copy: {