Skip to content

Instantly share code, notes, and snippets.

View dipankardas011's full-sized avatar

Dipankar Das dipankardas011

View GitHub Profile
@dipankardas011
dipankardas011 / main.go
Created July 14, 2024 09:36
control the rate of messages
package main
import (
"fmt"
"sync/atomic"
"time"
)
func smoothOutListening(rc <-chan string) {
var ops atomic.Uint64
@dipankardas011
dipankardas011 / main.go
Created July 13, 2024 18:00
go workerpools
package main
import (
"fmt"
"log/slog"
"net/http"
"sync"
)
var urls = []string{
@dipankardas011
dipankardas011 / main.go
Last active May 11, 2024 09:14
go time ticker and context timeout
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
)
@dipankardas011
dipankardas011 / main.go
Last active May 3, 2024 09:05
Without kubernetes service exposed how to get http client connect?
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
"net/http"
"os"
@dipankardas011
dipankardas011 / .zshrc
Created February 29, 2024 09:48
zshrc-server
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH=$HOME/.local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="gnzh"
plugins=(git z)
@dipankardas011
dipankardas011 / README.md
Created February 18, 2024 05:08
Open Build Service By OpenSuse

Open Build Service By OpenSuse (Automation)

@dipankardas011
dipankardas011 / README.md
Last active January 24, 2024 15:27
automate-creation-self-signed-tls-certs
@dipankardas011
dipankardas011 / README.md
Last active December 21, 2023 17:19
Simple example of using go channels with context and having graceful termination

This gist provides a simple way to try out graceful termination

If any errors are there feel free to comment down below, I happy to fix them 👍

@dipankardas011
dipankardas011 / README.md
Last active July 9, 2024 15:51
Avoid Null pointer issues in go

used a interface called Option[T any] which helps in defining the types

image