[SASS] @extend、@mixin 差別

@extend 適合使用在合併相同程式碼 但需謹慎使用,會增加 selector 間的關聯 %title { color: red; font-size: 15px; font-weight: bold; } .main h2 { @extend %title } .content h3 { @extend %title } .sidebar h4 { @extend %title } 編譯出來會是 .main h2, .content h3 »

[Ruby] Ruby upgrade 2.1.2 to 2.4.2

遇到錯誤 /Users/stanchen/.rvm/gems/ruby-2.4.2/gems/therubyracer-0.12.2/lib/v8/conversion.rb:21: warning: constant ::Fixnum is deprecated 解決方式: 升級 gem “therubyracer” 版本到 0.12.3 Ref: Release a version of therubyracer with Ruby 2.4 support to rubygems »

[DB] Isolation

Dirty read transaction 還沒 commit,就已經讀得到更新後的結果 NON-repeatable reads 在同個 transaction 使用相同 query 卻讀取到不同資料 ps: dirty read 也是一種 non-repeatable reads Phantom read 在同個 transaction 連續讀取兩次時,讀取出來的筆數跟上次不同 Isolation Level Read Uncommitted: 代表 transaction 可以 »

dash 設定

!d deploy __repo__ to __env__ !ks knife solo cook web__00__.techbang.com !ta tmux attach %sfw SELECT * FROM ____ -- WHERE ; crontab -r crontab -e !s ssh web____ !b bundle install !csc cap staging rails:c !csd cap staging deploy !csrc cap »

SSR & CSR

Server Side Render (SSR) 在 server 端透過 template 加上 data,將網頁產生 優點: SEO 較佳: 在 server 端就產生好頁面,爬蟲可直接抓取 Faster Time-to-content: 不需等 js 下載完畢就能到內容 缺點: 使用者體驗不佳: 須重新 reload 頁面才能拿到新的頁面 Client Side Render (CSR) 主要是把 render 從 server side 搬到 client side »

[AWS] EC2 CPU Credit

什麼是 CPU Credit 傳統 EC2 instance 如: M3, C3 提供固定的性能 而彈性性能主機(Burstable Performance Instances) 如: T2 提供 Baseline CPU Performance,並能彈性增加到 baseline 之上 CPU Credit 影響 CPU Credit 越高, 處理的效率會越好 ; 反之 credit 越低, 處理效率就越差 cpu 保持低於 baseline 以下的話, credit 是會加回來的, 直 »