-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
45 lines (45 loc) · 17 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!doctype html><html lang><head><meta name=generator content="Hugo 0.110.0"><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=robots content="noodp"><meta http-equiv=x-ua-compatible content="IE=edge, chrome=1"><title>Kourtney's Blog</title><meta name=Description content><meta property="og:title" content="Kourtney's Blog"><meta property="og:description" content><meta property="og:type" content="website"><meta property="og:url" content="http://klee1611.github.io/"><meta property="og:site_name" content="Kourtney's Blog"><meta name=twitter:card content="summary"><meta name=twitter:title content="Kourtney's Blog"><meta name=twitter:description content><meta name=application-name content="Kourtney's Blog"><meta name=apple-mobile-web-app-title content="Kourtney's Blog"><link rel="shortcut icon" type=image/x-icon href=/favicon.ico><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png><link rel=manifest href=/site.webmanifest><link rel=canonical href=http://klee1611.github.io/><link rel=alternate href=/index.xml type=application/rss+xml title="Kourtney's Blog"><link rel=feed href=/index.xml type=application/rss+xml title="Kourtney's Blog"><link rel=stylesheet href=/lib/normalize/normalize.min.css><link rel=stylesheet href=/css/style.min.css><link rel=stylesheet href=/lib/fontawesome-free/all.min.css><link rel=stylesheet href=/lib/animate/animate.min.css><meta name=google-site-verification content="WLcU5DjZJSqz0doT_JYXHt6H-4I0EE_iWnsqFqyO1E0"><script type=application/ld+json>{"@context":"http://schema.org","@type":"WebSite","url":"http:\/\/klee1611.github.io\/","author":{"@type":"Person","name":"Kourtney Lee"},"name":"Kourtney's Blog"}</script></head><body header-desktop header-mobile><script type=text/javascript>(window.localStorage&&localStorage.getItem("theme")?localStorage.getItem("theme")==="dark":"dark"==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches:"dark"==="dark")&&document.body.setAttribute("theme","dark")</script><div id=mask></div><div class=wrapper><header class=desktop id=header-desktop><div class=header-wrapper><div class=header-title><a href=/ title="Kourtney's Blog">Kourtney's Blog</a></div><div class=menu><div class=menu-inner><a class=menu-item href=https://github.com/klee1611 rel="noopener noreffer" target=_blank><i class='fab fa-fw fa-github'></i> GitHub </a><a class=menu-item href=/posts/>文章 </a><a class=menu-item href=/tags/>標簽 </a><a class=menu-item href=/categories/>分類 </a><span class="menu-item delimiter"></span><a href=javascript:void(0); class="menu-item language" title=選擇語言>繁體中文<i class="fas fa-chevron-right fa-fw"></i>
<select class=language-select id=language-select-desktop onchange="location=this.value"><option value=/ selected>繁體中文</option><option value=/en/>English</option></select>
</a><a href=javascript:void(0); class="menu-item theme-switch" title=切換主題><i class="fas fa-adjust fa-fw"></i></a></div></div></div></header><header class=mobile id=header-mobile><div class=header-container><div class=header-wrapper><div class=header-title><a href=/ title="Kourtney's Blog">Kourtney's Blog</a></div><div class=menu-toggle id=menu-toggle-mobile><span></span><span></span><span></span></div></div><div class=menu id=menu-mobile><a class=menu-item href=https://github.com/klee1611 title rel="noopener noreffer" target=_blank><i class='fab fa-fw fa-github'></i>GitHub</a><a class=menu-item href=/posts/ title>文章</a><a class=menu-item href=/tags/ title>標簽</a><a class=menu-item href=/categories/ title>分類</a><a href=javascript:void(0); class="menu-item theme-switch" title=切換主題>
<i class="fas fa-adjust fa-fw"></i>
</a><a href=javascript:void(0); class=menu-item title=選擇語言>繁體中文<i class="fas fa-chevron-right fa-fw"></i>
<select class=language-select onchange="location=this.value"><option value=/ selected>繁體中文</option><option value=/en/>English</option></select></a></div></div></header><div class="search-dropdown desktop"><div id=search-dropdown-desktop></div></div><div class="search-dropdown mobile"><div id=search-dropdown-mobile></div></div><main class=main><div class=container><div class="page home" posts><div class=home-profile><div class=home-avatar><a href=https://github.com/klee1611 title=GitHub rel="noopener noreffer" target=_blank><img class=lazyload src=/svg/loading.min.svg data-src="https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp" data-srcset="https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp, https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp 1.5x, https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp 2x" data-sizes=auto alt="https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp" title="https://www.gravatar.com/avatar/206912d6900c65386f24516df605c206?s=240&d=mp"></a></div><h1 class=home-title>Kourtney's Space</h1><h2 class=home-subtitle><div id=id-1 class=typeit></div></h2><div class=links><a href=https://github.com/klee1611 title=GitHub target=_blank rel="noopener noreffer me"><i class="fab fa-github-alt fa-fw"></i></a><a href=https://linkedin.com/in/kuo-hsiu-lee-5928b9a6 title=LinkedIn target=_blank rel="noopener noreffer me"><i class="fab fa-linkedin fa-fw"></i></a><a href=mailto:[email protected] title=Email rel=me><i class="far fa-envelope fa-fw"></i></a><a href=/index.xml title=RSS target=_blank rel="noopener noreffer me"><i class="fas fa-rss fa-fw"></i></a></div></div><article class="single summary" itemscope itemtype=http://schema.org/Article><h1 class=single-title itemprop="name headline"><a href=/posts/joplin-with-webdav-on-synology-ds918plus.html/>Joplin With Webdav on Synology 918plus</a></h1><div class=post-meta><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>Kourtney Lee</a></span> <span class=post-publish>發表於 <time datetime=2022-01-09>2022-01-09</time></span> <span class=post-category>收錄於 <a href=/categories/tools/><i class="far fa-folder fa-fw"></i>Tools</a></span></div><div class=content><p>原本使用的筆記軟體是 Notion,<br>功能相當強大;<br>但後來看到了一些隱私權爭議,<br>決定尋找有沒有替代的方案,<br>方便我儲存私人專案或清單之類的個人筆記;<br>然後就找到了<a href=https://joplinapp.org/ target=_blank rel="noopener noreffer">Joplin</a> 這套開源軟體。</p></div><div class=post-footer><a href=/posts/joplin-with-webdav-on-synology-ds918plus.html/>閱讀全文</a><div class=post-tags><i class="fas fa-tags fa-fw"></i> <a href=/tags/tools/>Tools</a></div></div></article><article class="single summary" itemscope itemtype=http://schema.org/Article><h1 class=single-title itemprop="name headline"><a href=/posts/remove-upgrade-npm-global-packages-after-installing-nvm.html/>Remove or Upgrade Global NPM Packages After Installing NVM</a></h1><div class=post-meta><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>Kourtney Lee</a></span> <span class=post-publish>發表於 <time datetime=2021-11-06>2021-11-06</time></span> <span class=post-category>收錄於 <a href=/categories/develop-environment/><i class="far fa-folder fa-fw"></i>Develop environment</a></span></div><div class=content>今天遇到一個問題,
安裝過 nvm 後安裝 global package 的路徑就被改變了,
導致想要移除之前安裝過的 global package 時沒辦法直接用 npm uninstall -g 移除。
怎麼發現這件事的呢?
很久以前我在 global 裝過一個 package 可以直接在 terminal 用 command 呼叫 command 執行,
但因為年代久遠,
要升級那個 package 的時候發現他不在 npm list -g 的範圍,
只好先用 which 看一下他在的位置,
接著發現是一個 link 然後就用 ls -al 看那個 link 連到哪裡,
發現是在 /usr/lib/node_modules 底下,
很明顯是用 npm -g 安裝的,
於是再仔細的看了一下 npm list -g 的結果,
發現其他的 global package 都列在 /Users/<USER_NAME>/.nvm/versions/node/v16.5.0/lib 底下,
在一陣 google 之後找到了一個方式 nvm use system && npm ls -g --depth=0 來列出原本安裝過的 global package 有哪些,</div><div class=post-footer><a href=/posts/remove-upgrade-npm-global-packages-after-installing-nvm.html/>閱讀全文</a><div class=post-tags><i class="fas fa-tags fa-fw"></i> <a href=/tags/programming/>Programming</a>, <a href=/tags/node.js/>Node.js</a></div></div></article><article class="single summary" itemscope itemtype=http://schema.org/Article><h1 class=single-title itemprop="name headline"><a href=/posts/pyenv-notes.html/>Pyenv Notes</a></h1><div class=post-meta><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>Kourtney Lee</a></span> <span class=post-publish>發表於 <time datetime=2021-11-01>2021-11-01</time></span> <span class=post-category>收錄於 <a href=/categories/develop-environment/><i class="far fa-folder fa-fw"></i>Develop environment</a></span></div><div class=content>pyenv 的功能和使用的原因 pyenv 是用來在系統裡安裝各種不同版本的 python,
並能夠方便的切換 python 版本的工具。
當同時有不同 python 版本的專案需要開發或維護時,
就會需要使用 pyenv 來協助切換 python 的版本。
python 的新版本通常都會有一些語法上的更新或是新增一些功能,
例如 python 的 async / await 就是 python 3.5 以上才出現的功能,
用 python 3.5 以下的版本來開發的專案就無法使用;
又或者例如同時有 python 2 和 python 3 的專案,
而且因為 python 2 和 python 3 語法不相容,
勢必要在系統裡安裝 python 2 和 python 3;
諸如次類的情況就可以使用 pyenv 方便的切換 python 的版本。
安裝和初始化 安裝
brew install pyenv 安裝完畢後執行初始化
pyenv init 之後按照指示將顯示的 code 貼到 ~/.zshrc 或 ~/.</div><div class=post-footer><a href=/posts/pyenv-notes.html/>閱讀全文</a><div class=post-tags><i class="fas fa-tags fa-fw"></i> <a href=/tags/programming/>Programming</a>, <a href=/tags/python/>Python</a></div></div></article><article class="single summary" itemscope itemtype=http://schema.org/Article><h1 class=single-title itemprop="name headline"><a href=/posts/python-coroutine-asyncio.html/>Python Coroutine Asyncio</a></h1><div class=post-meta><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>Kourtney Lee</a></span> <span class=post-publish>發表於 <time datetime=2021-10-27>2021-10-27</time></span> <span class=post-category>收錄於 <a href=/categories/concurrency-programming/><i class="far fa-folder fa-fw"></i>Concurrency Programming</a></span></div><div class=content><p>在出現 <code>asyncio</code> 前,<br>當一隻 Python 程式有很多需要並行執行的 task,<br>想要提升程式效能,<br>只能選用 multiprocessing 或 threading;<br>Python 3.4 之後又多出了 <code>asyncio</code> 的選擇。<br><code>asyncio</code> 可以用來撰寫 coroutines,<br>並使用 event loop 並行執行 coroutines,<br>減少程式不必要的等待時間以提升效能。</p></div><div class=post-footer><a href=/posts/python-coroutine-asyncio.html/>閱讀全文</a><div class=post-tags><i class="fas fa-tags fa-fw"></i> <a href=/tags/programming/>Programming</a>, <a href=/tags/python/>Python</a>, <a href=/tags/concurrent-processing/>Concurrent Processing</a></div></div></article><article class="single summary" itemscope itemtype=http://schema.org/Article><h1 class=single-title itemprop="name headline"><a href=/posts/pipenv-notes.html/>Pipenv Notes</a></h1><div class=post-meta><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>Kourtney Lee</a></span> <span class=post-publish>發表於 <time datetime=2021-09-26>2021-09-26</time></span> <span class=post-category>收錄於 <a href=/categories/develop-environment/><i class="far fa-folder fa-fw"></i>Develop environment</a></span></div><div class=content><h2 id=why-pipenv>Why Pipenv</h2><p>當有很多 Python project 要維護,<br>不同的 project 有可能使用相同的 python libraries 的不同版本,<br>不使用 virtual environment 而將所有的 python modules 都裝在自己的機器上就會造成版本衝突。</p><p>過去使用 <code>virtualenv</code> + <code>requirement.txt</code> 的機制可以在不同的 project 使用同一個套件的不同版本,<br>也能夠讓新加入的開發者或 production 環境可以快速安裝 project 需要的套件,</p></div><div class=post-footer><a href=/posts/pipenv-notes.html/>閱讀全文</a><div class=post-tags><i class="fas fa-tags fa-fw"></i> <a href=/tags/programming/>Programming</a>, <a href=/tags/python/>Python</a>, <a href=/tags/pipenv/>Pipenv</a></div></div></article><article class="single summary" itemscope itemtype=http://schema.org/Article><h1 class=single-title itemprop="name headline"><a href=/posts/stateless-http-stateful-session-and-cookies.html/>Stateless HTTP, Stateful Session and Cookies</a></h1><div class=post-meta><span class=post-author><a href=/ title=Author rel=author class=author><i class="fas fa-user-circle fa-fw"></i>Kourtney Lee</a></span> <span class=post-publish>發表於 <time datetime=2021-06-28>2021-06-28</time></span> <span class=post-category>收錄於 <a href=/categories/web/><i class="far fa-folder fa-fw"></i>Web</a></span></div><div class=content>Stateless HTTP HTTP 是一種 stateless 的 protocol,
也就是說每一次的 request / response 都是獨立的,
和之前或之後的 request / response 無關。
相同的 request 就會回應相同的 response,
不會因為之前的 request / response 內容而有不同。
這樣一來 server 因為不需要儲存使用者資訊可以省去大量的資料庫、伺服器儲存空間,
也因為不需要讓 client 每次都必須連線到相同的 socket 而能夠加快 response time 和省去不少 network bandwidth,
但在網站需要做連續動作(例如需要確認使用者身份認證時)就會需要一些機制來協助,
這時候大部分的網站就會利用 session 或 cookie。
Session Session 是一段具有狀態 (stateful) 的時間。
HTTP request / response 是 stateless 的,
但如果透過 stateless 的 request / response 夾帶 state 資訊的話,
client 和 server 就可以透過 request / response 夾帶的 state 資訊製造出 stateful 的運作。</div><div class=post-footer><a href=/posts/stateless-http-stateful-session-and-cookies.html/>閱讀全文</a><div class=post-tags><i class="fas fa-tags fa-fw"></i> <a href=/tags/web/>Web</a>, <a href=/tags/session/>Session</a>, <a href=/tags/cookie/>Cookie</a></div></div></article><ul class=pagination><li class="page-item active"><span class=page-link><a href=/>1</a></span></li><li class=page-item><span class=page-link><a href=/page/2/>2</a></span></li><li class=page-item><span class=page-link><a href=/page/3/>3</a></span></li><li class=page-item><span class=page-link><a href=/page/4/>4</a></span></li></ul></div></div></main><footer class=footer><div class=footer-container><div class=footer-line>由 <a href=https://gohugo.io/ target=_blank rel="noopener noreffer" title="Hugo 0.110.0">Hugo</a> 強力驅動 | 主題 - <a href=https://github.com/dillonzq/LoveIt target=_blank rel="noopener noreffer" title="LoveIt 0.2.10"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a></div><div class=footer-line><i class="far fa-copyright fa-fw"></i><span itemprop=copyrightYear>2023</span><span class=author itemprop=copyrightHolder> <a href=/ target=_blank>Kourtney Lee</a></span></div></div></footer></div><div id=fixed-buttons><a href=# id=back-to-top class=fixed-button title=回到頂端><i class="fas fa-arrow-up fa-fw"></i>
</a><a href=# id=view-comments class=fixed-button title=查看評論><i class="fas fa-comment fa-fw"></i></a></div><script type=text/javascript src=/lib/smooth-scroll/smooth-scroll.min.js></script><script type=text/javascript src=/lib/lazysizes/lazysizes.min.js></script><script type=text/javascript src=/lib/clipboard/clipboard.min.js></script><script type=text/javascript src=/lib/sharer/sharer.min.js></script><script type=text/javascript src=/lib/typeit/typeit.min.js></script><script type=text/javascript>window.config={code:{copyTitle:"複製到剪貼簿",maxShownLines:10},data:{"id-1":"Keep coding, keep learning"},typeit:{cursorChar:null,cursorSpeed:null,data:{"id-1":["id-1"]},duration:null,speed:null}}</script><script type=text/javascript src=/js/theme.min.js></script><script type=text/javascript>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}gtag("js",new Date),gtag("config","UA-127207785-1")</script><script type=text/javascript src="https://www.googletagmanager.com/gtag/js?id=UA-127207785-1" async></script></body></html>