See official doc: Using Go Guru
go get golang.org/x/tools/cmd/guru
guru -helpGuru command line usage:
| GOCMD=go | |
| GOTEST=$(GOCMD) test | |
| GOVET=$(GOCMD) vet | |
| BINARY_NAME=example | |
| VERSION?=0.0.0 | |
| SERVICE_PORT?=3000 | |
| DOCKER_REGISTRY?= #if set it should finished by / | |
| EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true | |
| GREEN := $(shell tput -Txterm setaf 2) |
| ################################################### | |
| ## | |
| ## Alertmanager YAML configuration for routing. | |
| ## | |
| ## Will route alerts with a code_owner label to the slack-code-owners receiver | |
| ## configured above, but will continue processing them to send to both a | |
| ## central Slack channel (slack-monitoring) and PagerDuty receivers | |
| ## (pd-warning and pd-critical) | |
| ## |
See official doc: Using Go Guru
go get golang.org/x/tools/cmd/guru
guru -helpGuru command line usage:
| # Login to AWS registry (must have docker running) | |
| docker-login: | |
| $$(aws ecr get-login --no-include-email --region us-east-1 --profile=mycompany) | |
| # Build docker target | |
| docker-build: | |
| docker build -f Dockerfile --no-cache -t mycompany/myapp . | |
| # Tag docker image | |
| docker-tag: |
| FROM python:2.7.14-alpine | |
| RUN apk add --no-cache \ | |
| --allow-untrusted \ | |
| --repository \ | |
| http://dl-3.alpinelinux.org/alpine/edge/testing \ | |
| hdf5 \ | |
| hdf5-dev && \ | |
| apk add --no-cache \ | |
| build-base | |
| RUN pip install --no-cache-dir --no-binary :all: tables h5py |
We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()| # Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib | |
| # in an Alpine based Docker image. | |
| FROM alpine:3.4 | |
| RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
| RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev | |
| RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | |
| RUN pip install numpy scipy pandas matplotlib | |
| #!/bin/bash | |
| name=$RANDOM | |
| url='http://localhost:9093/api/v1/alerts' | |
| echo "firing up alert $name" | |
| # change url o | |
| curl -XPOST $url -d "[{ | |
| \"status\": \"firing\", |
Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"
This is a guide to show you step by step how this can be setup. If you just want to get started, use the cookiecuter I set up cookiecutter-django-reactjs. It basically is a fork of pydanny's cookiecutter, just added the front-end stuff :).
I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)
Main features:
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :