Skip to content

Instantly share code, notes, and snippets.

@raymondzhaoy
raymondzhaoy / default.conf
Created March 7, 2017 08:11
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@raymondzhaoy
raymondzhaoy / sample1.txt
Created May 8, 2018 02:36
I am doing well
I am sample1 file text
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=mybinary
BINARY_UNIX=$(BINARY_NAME)_unix
@raymondzhaoy
raymondzhaoy / NOTE.md
Created June 1, 2018 08:35 — forked from tcnksm/NOTE.md
Small note of gRPC Best Practice @ CoreOSFest 2017
@raymondzhaoy
raymondzhaoy / build.sh
Created June 6, 2018 05:30 — forked from bobbytables/build.sh
Protocol Buffer build script for multiple folders
#!/usr/bin/env bash
# This script is meant to build and compile every protocolbuffer for each
# service declared in this repository (as defined by sub-directories).
# It compiles using docker containers based on Namely's protoc image
# seen here: https://github.com/namely/docker-protoc
set -e
REPOPATH=${REPOPATH-/opt/protolangs}
CURRENT_BRANCH=${CIRCLE_BRANCH-"branch-not-available"}
@raymondzhaoy
raymondzhaoy / kmeans.py
Created June 7, 2018 01:39 — forked from naufraghi/kmeans.py
kmeans algorithm in python + iris dataset (naive implementation)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Matteo Bertini <matteo@naufraghi.net>
# Licensed as http://creativecommons.org/licenses/BSD/
#
# This is a naive implementation of the k-means unsupervised clustering
# algorithm (http://en.wikipedia.org/wiki/K-means_clustering).
from __future__ import division
import sys
@raymondzhaoy
raymondzhaoy / gist:eeea7c50003d8c9fac84b548e6847098
Created June 7, 2018 05:59 — forked from mattetti/gist:3798173
async fetching of urls using goroutines and channels
package main
import (
"fmt"
"net/http"
"time"
)
var urls = []string{
"http://pulsoconf.co/",
@raymondzhaoy
raymondzhaoy / minikube-sierra.md
Last active June 11, 2018 05:15 — forked from inadarei/minikube-sierra.md
Minikube Setup: Docker for Mac / Sierra

Prerequisite: latest Docker for Mac on MacOS Sierra

$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.26.1/minikube-darwin-amd64 &amp;&amp; chmod +x minikube &amp;&amp; sudo mv minikube /usr/local/bin/
@raymondzhaoy
raymondzhaoy / http.md
Created June 11, 2018 01:44 — forked from inadarei/http.md
HTTP 1.1 Latest RFCs
  1. RFC7230 Message Syntax and Routing
  2. RFC7231 Semantics & Content - methods, status codes and headers
  3. RFC7232 Conditional Requests - e.g., If-Modified-Since
  4. RFC7233 Range Requests - getting partial content
  5. RFC7234 Caching - browser and intermediary caches
  6. RFC7235 Authentication - a framework for HTTP authentication

This is my response to an email asking about Domain-Driven Design in golang project.

Thank you for getting in touch. Below you will find my thoughts on how golang works with DDD, changing it. This is merely a perception of how things worked out for us in a single project.

That project has a relatively well-known domain. My colleagues on this project are very knowledgeable, thoughtful and invested in quality design. The story spelled out below is a result of countless hours spent discussing and refining the approach.

Conclusions could be very different, if there was a different project, team or a story-teller.

Short story