Skip to content

Instantly share code, notes, and snippets.

View manigandand's full-sized avatar
👨‍💻
Go, MongoDB, NodeJS, Kubernetes

Manigandan Dharmalingam manigandand

👨‍💻
Go, MongoDB, NodeJS, Kubernetes
View GitHub Profile
@manigandand
manigandand / slice_append.go
Created April 25, 2021 17:22
Slice: append vs set performance comparison
package main
import (
"fmt"
"reflect"
"strings"
"unsafe"
)
func main() {
@manigandand
manigandand / .tmux.conf
Last active March 1, 2023 08:24
Mac Setup
set-window-option -g xterm-keys on
set default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
set-window-option -g mode-keys vi
# split panes using | and -
unbind '"'
unbind %
bind | split-window -h
bind - split-window -v
@primaryobjects
primaryobjects / commit.png
Last active May 31, 2023 09:34
How to setup prettier as a pre-commit hook for Git commits.
commit.png
@LeCoupa
LeCoupa / redis_cheatsheet.bash
Last active March 18, 2024 09:08
Redis Cheatsheet - Basic Commands You Must Know --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@wojteklu
wojteklu / clean_code.md
Last active April 23, 2024 13:15
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@AntoineAugusti
AntoineAugusti / limitConcurrentGoroutines.go
Last active April 8, 2024 08:33
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mattetti
mattetti / multipart_upload.go
Last active April 22, 2024 05:24
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@andelf
andelf / sendMail.go
Last active September 20, 2023 15:13
golang send mail net/smtp SMTP
package main
import (
"log"
"net/mail"
"encoding/base64"
"net/smtp"
"fmt"
"strings"