# cat -A will display a $ at the end of every line, so it'll be visually more pleasing than a regular grep.
cat -A < configmap.yaml | grep ' \$$'
# cat -T will show your tabs as ^I.
cat -T < configmap.yaml | fgrep '^I'
# vi: replace \t with four space
This file contains hidden or 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
go get -v github.com/stamblerre/gocode | |
go get -v github.com/ramya-rao-a/go-outline | |
go get -v golang.org/x/tools/gopls | |
go get -v golang.org/x/tools/cmd/goimports | |
go get -v github.com/acroca/go-symbols | |
go get -v golang.org/x/tools/cmd/guru | |
go get -v golang.org/x/tools/cmd/gorename | |
go get -v github.com/godoctor/godoctor | |
go get -v github.com/fatih/gomodifytags | |
go get -v github.com/josharian/impl |
This file contains hidden or 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
ssh -fCPN -L 0.0.0.0:{localPort}:{targeIP}:{targetPort} root@127.0.0.1 |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Document</title> | |
</head> | |
<body> |
This file contains hidden or 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
/** | |
* FormatTime 格式化时间 | |
* @param timestamp 时间戳,单位:秒 | |
* @returns | |
* < 60s => 刚刚 | |
* < 60 * 60s => n分钟前 | |
* < 24 * 60 * 60s => n小时前 | |
* => yyyy-MM-dd | |
*/ | |
export function FormatTime(timestamp) { |
- https://medium.com/@charpeni/arrow-functions-in-class-properties-might-not-be-as-great-as-we-think-3b3551c440b1
- https://medium.com/@joespinelli_6190/using-arrow-functions-to-avoid-binding-this-in-react-5d7402eec64
- https://stackoverflow.com/questions/50375440/binding-vs-arrow-function-for-react-onclick-event
This file contains hidden or 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
-- https://www.a2hosting.com/kb/developer-corner/mysql/determining-the-size-of-mysql-databases-and-tables | |
SELECT table_schema AS "Database", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; | |
SELECT table_name AS "Table", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
WHERE table_schema = "database_name" |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains hidden or 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
docker run -it --entrypoint=/bin/bash $IMAGE -i |
NewerOlder