Skip to content

Instantly share code, notes, and snippets.

View hlkn's full-sized avatar

Henry LK Nguyen hlkn

View GitHub Profile
@hlkn
hlkn / makefile
Created May 3, 2023 13:43 — forked from serinth/makefile
Golang Makefile
# Basic Makefile for Golang project
# Includes GRPC Gateway, Protocol Buffers
SERVICE ?= $(shell basename `go list`)
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || cat $(PWD)/.version 2> /dev/null || echo v0)
PACKAGE ?= $(shell go list)
PACKAGES ?= $(shell go list ./...)
FILES ?= $(shell find . -type f -name '*.go' -not -path "./vendor/*")
# Binaries
PROTOC ?= protoc
@hlkn
hlkn / Makefile
Created May 3, 2023 13:44 — forked from kwilczynski/Makefile
Makefile for my Go projects (an example).
SHELL := /bin/bash
REV := $(shell git rev-parse HEAD)
CHANGES := $(shell test -n "$$(git status --porcelain)" && echo '+CHANGES' || true)
TARGET := packer-provisioner-itamae-local
VERSION := $(shell cat VERSION)
OS := darwin freebsd linux openbsd
ARCH := 386 amd64
@hlkn
hlkn / machine.js
Created July 12, 2023 05:19
Generated by XState Viz: https://xstate.js.org/viz
const waterMachine = Machine({
id: 'water',
initial: 'liquid',
states: {
ice: {
on : {
HEAT: {
target: "liquid"
@hlkn
hlkn / machine.js
Last active July 15, 2023 15:56
Generated by XState Viz: https://xstate.js.org/viz
const DbHealthLifeCycle = Machine ({
id: 'VipFlow',
initial: 'start',
states: {
start: {
on: {
pass1: 'validate'
}
},
validate: {