Skip to content

Instantly share code, notes, and snippets.

View kamal-github's full-sized avatar
:octocat:
Focusing

Kamal Namdeo kamal-github

:octocat:
Focusing
View GitHub Profile
@aalemayhu
aalemayhu / gs_gofmt.bash
Created March 17, 2017 09:36
Run gofmt on changed files
for x in `git status -s|awk '{ print $2}'`; do gofmt -w $x; done
@kamal-github
kamal-github / ZshSetup.md
Last active October 16, 2018 14:50
Zsh Setup with Ohmyzsh

Install Zsh using OhMyZsh https://github.com/robbyrussell/oh-my-zsh

For setting default user - ohmyzsh/ohmyzsh#2033 to remove the user and computer name on command prompt. set DEFAULT_USER=whoami with backquotes around whoami

Choose theme - agnoster

Install Plugins

git, golan, kubectl, sudo, docker, docker-compose, iterm2

@ribice
ribice / caller.go
Last active July 7, 2023 07:07
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@kamal-github
kamal-github / OrDoneChannel.go
Last active November 22, 2020 08:27
Or Done channel - Concurrency in Go Book
package main
import (
"fmt"
"time"
)
// Simpler version for Or
func OrVer2(ch ...chan struct{}) <-chan struct{} {
switch len(ch) {
@kamal-github
kamal-github / fan-out-in.go
Last active November 21, 2020 17:00
Fan out and Fan in pattern in Go
package main
import (
"fmt"
"runtime"
"sync"
)
func main() {
// can be a input stream such as CSV/Network/File.