Skip to content

Instantly share code, notes, and snippets.

kubectl get pods --all-namespaces -o jsonpath='{range .items[*]}{@.metadata.name}{" "} {@.spec.containers[*].image} {@.spec.containers[*].imagePullPolicy}{"\n"}{end}' | sort | uniq -c | grep Always
kubectl get pods --all-namespaces -o jsonpath="{..image}" |\
tr -s '[[:space:]]' '\n' |\
sort |\
uniq -c
Fix eslint errors upon save in VsCode
Open the following file path: ~/Library/Application Support/Code/User/settings.json
```
{
// ... Existing JSON here ...
"editor.codeActionsOnSave": {
"source.fixAll": true
}
}
[CSS Battle - 在线比拼 CSS](https://cssbattle.dev)
Learn CSS layout - 学习 CSS 布局
http://learnlayout.com
Flexbox Froggy - 学习 Flex 布局的小游戏
http://flexboxfroggy.com
EnjoyCSS-在线CSS代码可视化工具
https://enjoycss.com
* find all files and use envsubst
find "directory" -name "*.tmpl" --exec bash -c 'envsubst < $1 > ${1%.tmpl}' _ {} \;
* find all files and use envsubst
find "directory" -name "*.tmpl" --exec bash -c 'envsubst < $1 > ${1%.tmpl}' _ {} \;
* use sed to get file name
echo "./page-components/Home/DownloadSection/index.stories" | sed 's/.*\///
@xinzhang
xinzhang / gist:cb62a711d01d04a7fd008a25708f6428
Created February 15, 2020 00:52
setup prettier and eslint
this is to setup
* in vscode, install prettier, eslint plugin (remove beautifier)
* npm install prettier eslint-config-prettier eslint-plugin-pretier --save-dev
* command + "," to add formatOnSave true
* add prettier.config.js
```
module.exports = {
$schema: 'http://json.schemastore.org/prettierrc',
arrowParens: 'always',
auth.sh
#!/bin/bash
mkdir -p "$HOME/.config/gcloud"
if [[ -n "$GCLOUD_SERVICE_KEY" ]]; then
echo "$GCLOUD_SERVICE_KEY" > "$HOME/.config/gcloud/application_default_credentials.json"
else
cat /root/auth/application_default_credentials.json > "$HOME/.config/gcloud/application_default_credentials.json"
fi
https://books.google.com.au/books?id=jF2yDwAAQBAJ&pg=PA61&lpg=PA61&dq=istio-tracing+keep+restarted&source=bl&ots=6O-qIy5jJy&sig=ACfU3U1U3aMitBR9eypzJQL_LsqKZWp85Q&hl=en&sa=X&ved=2ahUKEwjzgqv9-5rnAhWMyjgGHYCmDZsQ6AEwBXoECAoQAQ#v=onepage&q=istio-tracing%20keep%20restarted&f=false
search on istio-tracing keep restarted
@xinzhang
xinzhang / composing-software.md
Created January 17, 2020 04:09 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
git config --global push.default current