Skip to content

Instantly share code, notes, and snippets.


Ning Xie andyxning

View GitHub Profile
ebenoist / consumer.go
Last active Mar 1, 2020
nsq consumer
View consumer.go
package main
import (
View docker.dump
SIGABRT: abort
goroutine 308297 [syscall, 4433 minutes]:
syscall.Syscall6(0x3d, 0x10a0c, 0xc2084e3aec, 0x0, 0xc2084b86c0, 0x0, 0x0, 0xc208433400, 0x347, 0x3b7)
/usr/local/go/src/syscall/asm_linux_amd64.s:46 +0x5 fp=0xc2084e3a50 sp=0xc2084e3a48
syscall.wait4(0x10a0c, 0xc2084e3aec, 0x0, 0xc2084b86c0, 0x90, 0x0, 0x0)
/usr/local/go/src/syscall/zsyscall_linux_amd64.go:124 +0x79 fp=0xc2084e3ab0 sp=0xc2084e3a50
syscall.Wait4(0x10a0c, 0xc2084e3b34, 0x0, 0xc2084b86c0, 0x0, 0x0, 0x0)
/usr/local/go/src/syscall/syscall_linux.go:224 +0x60 fp=0xc2084e3af8 sp=0xc2084e3ab0
View Makefile
# Hello, and welcome to makefile basics.
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
# Once you're done here, go to
# to learn SOOOO much more.
bketelsen / nsqadmin-service.json
Last active Aug 26, 2020
This gist represents all the manifests you'll need to run a redundant and fault-tolerant NSQ cluster on Kubernetes. NSQ Admin's http interface is available on port 14171 on any node. There's an issue with NSQ Admin if you're running more than one lookupd service, so I recommend running just one lookupd until I figure it out.
View nsqadmin-service.json
"id": "nsqadmin-http",
"kind": "Service",
"apiVersion": "v1beta1",
"port": 14171,
"protocol": "TCP",
"selector": { "name": "nsqadmin" }
View Golang decorator
package main
import (
func decorator(f func(s string)) func(s string) {
return func(s string) {
nuxlli /
Last active Jul 2, 2020
Examples of http request (in unix domain socket) with bash and [nc|socat]
# References
andrewrcollins / trim.awk
Created Jan 11, 2012
ltrim(), rtrim(), and trim() in awk
View trim.awk
function ltrim(s) { sub(/^[ \t\r\n]+/, "", s); return s }
function rtrim(s) { sub(/[ \t\r\n]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
# whatever
# whatever
fajrif / gist:1265203
Created Oct 5, 2011
git clone specific tag
View gist:1265203
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master