kubectl get pods kubectl get pods --show-all| upstream uwsgi { | |
| # for a file socket | |
| server unix:///sock/app.sock; | |
| } |
| version: '3.7' | |
| services: | |
| app1: | |
| container_name: app1-container | |
| hostname: app1 | |
| restart: always | |
| build: | |
| context: ./app | |
| dockerfile: Dockerfile | |
| args: |
| # first_pod.yaml | |
| apiVersion: v1 | |
| kind: Pod | |
| metadata: | |
| name: k8s-pod-nodejs | |
| labels: | |
| app: webserver | |
| spec: | |
| containers: | |
| - name: k8s-pod-nodejs |
| // 測試迴圈內 "i" 的結果,這題要重新研究var 和 let 之間的關係(重點在全域綁定和區域綁定) | |
| for (var i = 0; i < 10; i ++) { | |
| setTimeout(function() { | |
| console.log(i); | |
| }, 10); | |
| } | |
| for (let i = 0; i < 10; i ++) { | |
| setTimeout(function() { | |
| console.log(i); | |
| }, 10); |
| <script src="https://unpkg.com/[email protected]/dist/vue.js"></script> | |
| <div id="app"> | |
| <p>the input is: <span class="name">{{result}}</span></p> | |
| <input type="text" | |
| :value=result | |
| @input="compositionend" | |
| @compositionstart="compositionstart($event)" | |
| @compositionend="compositionend($event)" | |
| /> | |
| </div> |
| class First(object): | |
| def member1(self, n): | |
| return n | |
| @classmethod | |
| def member2(cls, n): | |
| # Call the static member. | |
| n += cls.member3(n) | |
| # Call the normal member. | |
| n += cls.member1(cls, n) |
| // Nodejs's Path built-in library. | |
| let path = require('path'); | |
| // Get dir's path. | |
| let dirPath = path.dirname('/xx/yy/zz.js'); | |
| console.log('dirPath', dirPath); | |
| // Get join's path. | |
| let joinPath = path.join(__dirname, '/xx'); | |
| console.log('joinPath', joinPath); |
git commit --amend -m "<New message>"
// X is the number of commits to the last commit you want to be able to edit
git rebase -i HEAD~X
How to use the one command to copy JSON prettify JSON.
echo '{"test1": 1, "test2": true}' | json_pp => To show the result.echo '{"test1": 1, "test2": true}' | json_pp | pbcopy => To copy into paste note