Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Go, MongoDB, NodeJS, Kubernetes

Manigandan Dharmalingam manigandand

👨‍💻
Go, MongoDB, NodeJS, Kubernetes
View GitHub Profile
@manigandand
manigandand / concurrency.go
Created Jan 28, 2020
simple buffered concurrency golang
View concurrency.go
package main
import (
"fmt"
"sync"
)
func main() {
input := []int{1, 2, 3, 4, 5}
in := make(chan int)
@manigandand
manigandand / word_count.go
Created Nov 19, 2019
find words count in a given string
View word_count.go
// To execute Go code, please declare a func main() in a package "main"
package main
import (
"fmt"
// "strings"
)
View productivity.md

fuzzy search

https://github.com/junegunn/fzf 
https://github.com/zsh-users/zsh-autosuggestions

Mac

  • iterm
  • ohmyzsh: https://ohmyz.sh/
  • ohmyzsh theme: "agnoster" or "powerlevel10k/powerlevel10k"
View creating-a-self-signed-ssl-certificate.md

Create a secrets file:

touch ~/.secret

Make sure it looks like this:

#!/bin/bash
@manigandand
manigandand / test.sh
Last active Sep 26, 2018
Tmuxinator & Shell script to automate deployment
View test.sh
#!/bin/sh
#
DEPENDENCY_XDOTOOL=xdotool
DEPENDENCY_TMUXINATOR=tmuxinator
# Dependencies:
if ! type "$DEPENDENCY_XDOTOOL" > /dev/null; then
echo "$DEPENDENCY_XDOTOOL not found. installing it..."
sudo apt install xdotool
fi
if ! type "$DEPENDENCY_TMUXINATOR" > /dev/null; then
@manigandand
manigandand / installation_steps.md
Last active Sep 10, 2018
Yahoo’s Kafka Manager Installation
View installation_steps.md
@manigandand
manigandand / postgres-cheatsheet.md
Created Aug 1, 2018 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet
View postgres-cheatsheet.md

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@manigandand
manigandand / query.psql
Created Aug 1, 2018
Get distinct unqiue results
View query.psql
select a.id from TableA a \
JOIN TableB b ON a.id=b.tablea_id \
JOIN TableC AS c ON b.tableb_id=c.id \
where c.name IN ('java','python') \
group by a.id \
having count(distinct c.name)=2;
View client_proxy.go
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
@manigandand
manigandand / links.txt
Last active Jul 10, 2018
Golang pprof: profiling and tooling reference links
View links.txt