Skip to content

Instantly share code, notes, and snippets.

@16892434
16892434 / get-latest-tag-on-git.sh
Created August 4, 2022 01:28 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@16892434
16892434 / main.go
Created August 3, 2022 09:49 — forked from kpurdon/main.go
golang graceful server shutdown example
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@16892434
16892434 / cgo.md
Created July 29, 2022 01:54 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

# Source: https://gist.github.com/a5870806ae6f21de271bf9214e523b53
##################
# Create Cluster #
##################
minikube start --memory 6g --cpus 4
#################
# Install Istio #
@16892434
16892434 / Makefile
Created July 20, 2022 01:14 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
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)
@16892434
16892434 / Makefile.md
Created July 20, 2022 01:14 — forked from subfuzion/Makefile.md
Makefile for Go projects

Go has excellent build tools that mitigate the need for using make. For example, go install won't update the target unless it's older than the source files.

However, a Makefile can be convenient for wrapping Go commands with specific build targets that simplify usage on the command line. Since most of the targets are "phony", it's up to you to weigh the pros and cons of having a dependency on make versus using a shell script. For the simplicity of being able to specify targets that can be chained and can take advantage of make's chained targets,

@16892434
16892434 / language_acq.txt
Created January 28, 2022 01:08 — forked from ianfitzpatrick/language_acq.txt
Language Acquisition
Three background things:
1. Stephen Krashen’s Theory of Second Language Acquisition:
https://www.sk.com.br/sk-krash-english.html
Pretty much boils down to:
- Excessive-self monitoring and learning via grammar-first (see: duolingo) makes language acquisition way harder.
- We learn language via comprehensible input, “i + 1”, you need to find input that is + 1 past what you already know
- Stress, doubt, and basically being afraid to fuck up also kill language acquisition.
Here’s a lecture on his theories if you are interested: https://www.youtube.com/watch?v=t3lv7ExApHM&t=101s
Edit: Actually, this may be a better video. I’m having trouble finding one where he succinctly goes through his theories:
https://www.youtube.com/watch?v=Xn2k8I8by8o
@16892434
16892434 / language_acq.txt
Created January 28, 2022 01:08 — forked from jamfish/language_acq.txt
Language Acquisition
Three background things:
1. Stephen Krashen’s Theory of Second Language Acquisition:
https://www.sk.com.br/sk-krash-english.html
Pretty much boils down to:
- Excessive-self monitoring and learning via grammar-first (see: duolingo) makes language acquisition way harder.
- We learn language via comprehensible input, “i + 1”, you need to find input that is + 1 past what you already know
- Stress, doubt, and basically being afraid to fuck up also kill language acquisition.
Here’s a lecture on his theories if you are interested: https://www.youtube.com/watch?v=t3lv7ExApHM&t=101s
Edit: Actually, this may be a better video. I’m having trouble finding one where he succinctly goes through his theories:
https://www.youtube.com/watch?v=Xn2k8I8by8o
@16892434
16892434 / Quah-D-2020.08-Pandoc-Workflow-Markdown-PDF.md
Created December 21, 2021 10:35 — forked from DannyQuah/2020.08-D.Quah-Pandoc-Workflow-Markdown-PDF.md
My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical Writing

My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical Writing

by Danny Quah Aug 2020

TL;DR: I write technical articles in LaTeX. But shorter, non-technical writings are easier to do in Markdown. How do I produce PDF from Markdown documents? Answer: provide YAML information in the Markdown; run Pandoc (typically through a Makefile or Atom's Markdown Preview Enhanced). To make all this work, some adjustment is needed in Pandoc options and template files.

Pandoc is a filter that takes a written document in its given format, and produces a version of that same document in yet a different format. I use Pandoc primarily to transform Markdown documents to PDF, but I also draw on Pandoc to convert Word or ODT documents to Markdown. Or vice versa.

@16892434
16892434 / mnist.go
Created June 29, 2021 07:07 — forked from higuma/mnist.go
MNIST database reader with Golang
// MNIST database reader
// http://yann.lecun.com/exdb/mnist/
package mnist
import (
"fmt"
"os"
"path/filepath"
)