> For the complete documentation index, see [llms.txt](https://zhang699-2.gitbook.io/note/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zhang699-2.gitbook.io/note/shang-wei-zheng-li.md).

# 尚未整理

## Google Stack Driver logging

在未使用Docker 與 GCP 的時候，裸上nodejs 可以使用到GCP 的 log console

{% embed url="<https://cloud.google.com/logging/docs/setup/nodejs?hl=zh-tw>" %}

## Docker

Different with VM

* <https://docs.docker.com/get-started/#a-brief-explanation-of-containers>

MAC

* <https://store.docker.com/editions/community/docker-ce-desktop-mac>

Ubuntu

* <https://philipzheng.gitbooks.io/docker_practice/content/install/ubuntu.html>

## HTML Canvas

* BeginPath to refresh previous moveTo
* FillStyle to setup color
* stroke to draw the line
* draw circle in canvas by using arc(x, y, radius, startAngle, endAngle)
  * <https://www.w3schools.com/tags/canvas_arc.asp>
* use Time variable to make animation in canvas
* Draw a circle by connecting each two points as a line
* References
  * <https://www.youtube.com/watch?v=fVAE28YTCMs>

## Swagger

swagger-node, create template project of node

swagger-ui

swagger-mock

describe response's property as null result to avoid **Fail to schema validation problem**

![](/files/-LfNCpHO9ccv3M7LJFg8)

Add Authorize in Swagger API

1. Write Swagger Spec as following:![](/files/-LfNCpHQY0fhHepd2FKv)
2. Declare security need inside API's schema

   ![](/files/-LfNCpHShsOkJ08E8Zuv)
3. Prepare swaggerSecurityHeandlers and verified API there
4. ```
   var config = {
     appRoot: __dirname, // required config
     swaggerSecurityHandlers: {
       Bearer: function (req, authOrSecDef, scopesOrApiKey, callback) {
         console.warn('apiKey', scopesOrApiKey);
         if (scopesOrApiKey === TOKEN) {
           callback();
         } else {
           callback(new Error('API Key not matched'))
         }
       },
     },
   };
   ```

## Ideas

MapFriends

* 以看到事件距離自己目前地點的距離收費，e.g. 1km 的半徑免費 以上收費
* 要以聲音進行溝通，無文字
* 可以上傳大頭貼與FB/Google 登入 或匿名
* 匿名如何建立事件？ 必須留email ?
* Disable file cache.

`/etc/nginx/nginx.conf`

`sendfile off`

### Stored Bitbucket password not updated

`remote: Too many invalid password attempts. Try logging in through the website with your password.`

`fatal: unable to access 'https://zhang699@bitbucket.org/zhang699/rotan.git/': The requested URL returned error: 403`

Solution: Update MAC's KeyChain

![](/files/-LfNCpHUha7jVhoiNKRw)
