This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- iTerm2 | |
- set default window -> save arrangement -> use default | |
- brew | |
- go | |
- mockgen | |
- golangci-lint | |
- all dependencies in repo indrasaputra/toggle | |
- vscode | |
- docker | |
- telegram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# delete all untagged docker images | |
docker rmi -f $(docker images -a | awk '/none/ {print $3}') | |
# delete all unnecessary volume | |
docker volume ls | grep -v DRIVER | awk '{print $2}' | grep -x '.\{30,100\}' | xargs docker volume rm | |
# delete all past container | |
docker ps -a | grep -v CONTAINER | awk '{print $1}' | xargs docker rm -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// Distance defines the distance of a point | |
// using row and column as measurement. | |
type Distance struct { | |
Row int | |
Column int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (c *Checker) CheckStandardsGoroutineChannel(ctx context.Context, svc *Service, svcChan chan *Service, errChan chan []error) { | |
// this function still does what CheckStandards does, | |
// but instead of returning the values, | |
// it sends the values to channel | |
svcChan <- svc | |
errChan <- errorList | |
} | |
func main() { | |
ctx := context.Background() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
ctx := context.Background() | |
kube := &Kubernetes{} | |
checker := &Checker{} | |
services, _ := kube.AllServices(ctx) | |
// let's make a new services container | |
// so we don't bother with pointer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Kubernetes struct { | |
// omitted | |
} | |
type Service struct { | |
Name string | |
HasMetric bool | |
HasLog bool | |
HasDocument bool | |
HasCICD bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package blog | |
import "time" | |
// Article is our beloved article struct. | |
// This struct can be moved to another package, | |
// such as `package entity`. | |
// But, I choose to put it here because | |
// of readability reason. | |
type Article struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Blog is the main business process(es). | |
type Blog interface { | |
// CreateArticle creates an article then publish it. | |
CreateArticle(article Article) error | |
// GetArticles retrieves an article based on its id. | |
GetArticle(id int) (Article, error) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <iostream> | |
#include <cstring> | |
#include <vector> | |
#include <cstdlib> | |
#include <algorithm> | |
#include <map> | |
#include <utility> | |
#include <cctype> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <cmath> | |
#include <string> | |
#include <cstring> | |
#include <queue> | |
#include <stack> |
NewerOlder