文章加密

;

2020年7月5日 星期日

nuxt, npx

https://www.freecodecamp.org/news/npm-vs-npx-whats-the-difference/

npm vs npx

npm:
npm i -g create-nuxt-app
create-nuxt-app <項目名稱>

等於

npx:
npx create-nuxt-app <項目名稱>

2020年7月4日 星期六

解決同源問題

jsonp 
https://www.w3schools.com/js/js_json_jsonp.asp
 JSONP 的缺點就是你要帶的那些參數「 永遠都只能用附加在網址上的方式(GET)帶過去,沒辦法用 POST 」。

很重要的一點是,要使用 JSONP 傳送資料,也要 Server 端有提供 JSONP 的方法( 意指用 callback function 包起來 )才行,不然回傳的 Response 就只是字串而已,沒有辦法取得資料。


但一般開發其實只要:
只要 Server 端在 response 的 header 加上一行,就可以允許不同網域的 request 存取
access-control-allow-origin: *


同源政策
主要是為了安全性。
很重要的一點是,同源政策只跟「 瀏覽器 」有關,所以用 Node.js 並沒有這層限制。

程序員的英文

a leading period  means a leading dot

pip

https://matthung0807.blogspot.com/2019/08/windows-pythonpip.html
pip 是python檔案管理工具

2020年7月3日 星期五

mac windows linux 都是作業系統

mac 圖形處理功能非常出色,多媒體功能也很好
linux 網絡功能非常強大,對內存等硬體的消耗也小,用來建web server
windows 應用程式軟體最多

2020年7月2日 星期四

git tag有兩種--lightwight tag vs anotated tag,git cherry-pick,git revert,merge v.s rebase

https://gitbook.tw/chapters/tag/using-tag.html

lightwight tag 
git tag <tag name> <commit sha1>


anotated tag
git tag <tag name> <commit sha1> -a -m "message"
其中-a 表示為anotated tag


  1. Annotated tags are meant for release while lightweight tags are meant for private or temporary object labels.
    有附註標籤主要用來做像是軟體版號之類的用途,而輕量標籤則是用來個人使用或是暫時標記用途。簡單的說,有附註標籤的好處就是有更多關於這張標籤的資訊,例如是誰在什麼時候貼這張標籤,以及為什麼要貼這張標籤。所以如果你不是很在乎這些資訊,用一般的輕量標籤也是沒什麼問題。
  2. 不管是哪種標籤,跟分支一樣都是以檔案方式存在 .git/refs/tags 目錄下
  3. 不管是哪一種標籤,刪除都一樣是 git tag -d <tag name>
git cherry-pick <commit1> <commit2> ...
檢想要的commit過來,可以多個也可以只一個,並且過來後直接merge進去(如果沒有衝突的話)。
想要不直接merge,而是先在staged狀態,則用--no-commit 參數
https://gitbook.tw/chapters/faq/cherry-pick.html

git revert <commit>
Revert 的指令是「再做一個新的 Commit,來取消你不要的 Commit」的概念。
常加上 --no-edit 參數,表示不編輯 Commit 訊息

實務說明為什麼要用rebase
https://ithelp.ithome.com.tw/m/articles/10225867
這樣做出來的小耳朵才是真正git flow的運應吧!
git pull --rebase
git merge --no-ff

git rebase 後再git merge就會是一條線
$ git checkout dev
$ git rebase -i master
$ git checkout master
$ git merge dev
或是用--no-ff 有小耳朵(不過在以下情境則必定會有:需要長久開發的功能,我會在 remote 開 feature branch。回來的時候 master 應該已有別人的 commits,所以我的使用情境大概不會用到。)
$ git checkout dev
$ git rebase -i master
$ git checkout master
$ git merge dev --no-ff
這篇很棒~
https://www.slideshare.net/WillHuangTW/git-merge-rebase

git rebase -i
interactive mode
https://dotblogs.com.tw/wasichris/2016/05/04/re


what is metadata
Metadata常見的解釋為「data about data」,直譯成中文為「有關資料的資料」或「描述資料的資料」。 國內學者針對Metadata一詞,有不同譯名,吳政叡教授稱為「元資料」,陳雪華教授的「詮釋資料」,陳昭珍教授的「超資料」,我國國家數位典藏計畫的「後設資料」。


ts