出清電腦書 (2008)

Update(2009/2/4): 新增 jQuery in Action
Update(2008/5/22): 新增幾本 CSS/Javascript 書
Update(2008/3/26): 郵資加 70 元(郵局包裹)

之前買的好書放了好一陣子沒時間看,出清給會念的人好了。書況都很新沒有劃線,只有翻閱過幾次(?)而已。書名後的數字就是直接購買價,請直接寫 E-mail ihower {at} GMail.com 給我,不放心的話可以透過Y!拍賣下定(價格以 Y! 為準,懶得更新下面的價格了)

Web design

  1. Web Accessibility $1200
  2. Web Standards Programmer’s Reference $900
  3. CSS Instant Results $250
  4. designing web graphics.4, 4/e $450
  5. Bulletproof Web Design $300
  6. Ajax Patterns and Best Practices $650
  7. jQuery in Action $900
  8. Beyond Borders: Web Globalization Strategies $700

UI

  1. Access by Design $500
  2. About Face 2.0: The Essentials of Interaction Design $650
  3. Experience Design $450
  4. Fresh Style for Web Designers $250

Security

  1. Professional Pen Testing for Web Applications $900
  2. Mastering FreeBSD and OpenBSD Security $750
  3. Security and Usability $800
  4. 駭客訓練基地 $250
  5. 初探網路安全 first-step $250

Object,UML…etc

  1. Applying Use Cases: A Practical Guide (2nd Edition) $550
  2. UML 使用手冊 $300

Other

  1. Developing Feed with RSS and Atom $650
  2. WebDAV $800
  3. BSD Hacks $450
  4. Capacity Planning for internet Services $400
  5. Postfix 技術手冊 $350
  6. POSTFIX 技術手札 $300
  7. Postfix 郵件伺服器白皮書 $300
  8. Google 廣告工具 $300
  9. CGI Programming with Perl $400
  10. 多平台環境系統管理 $300
  11. Local and Metropolitan Area Networks (6th Edition) $250

PHP

  1. PHP in a Nutshell $300
  2. 真PHP5技術手札 $150

Textmate on Rails 2

Rails on Rails 已經出到 2.0 了,不過 Textmate 內建的 Bundle 還是 1.x,需要更新。請下載 Textmate bundle,最好的方式是用 git,不過也可以直接下載放到 [~/Library/Application Support/TextMate/Bundles] 下,並命名為 Ruby on Rails.tmbundle,然後在 textmate 裡 reload bundle 即可。

另外也請在 [/Applications/TextMate.app/Contents/SharedSupport/Support/lib] 執行 mv Builder.rb Builder.rb.off (不然某些用到 rake 的 bundle 會有錯誤)。

來背指令吧~列了幾個自己想要記下來用的。

Ctrl+command + T : 查詢 bundle 指令

閱讀全文〈Textmate on Rails 2〉

演講: Rails2’s template 可以怎麼玩 (HappyDesigner)

Update(2008/3/29): 投影片在此

久違的 HappyDesigner 聚會終於又在辦啦。響應聚會主題“Template, Library, and Framework”,我打算分享的題目是 “Rails2’s template 可以怎麼玩”,內容將會介紹 Ruby on Rails 的 respond_to 機制和各種 template 應用。

  • 時間:2008-03-29 PM 01:30 ~ PM 06:00
  • 地點:新竹Newton’s A蘋果電腦專賣店(地址:新竹市建中一路25號2樓)
  • 官方文宣
  • 報名網頁

FaceboxRender: Rails 無縫使用 lightbox

FaceboxRender 是我最近寫的第二個 Ajax UI plugin,它讓你在 Rails 中可以無縫使用 lightbox 效果,搭配使用的 Javascript library 正如其名是 Facebox。首先你得先裝好 jQuery 和 Facebox:

  1. 下載 jQuery (建議你可以考慮用 jRails 完全換掉 Prototype library)
  2. 下載 facebox
  3. 把 facebox js file 放到 /public/javascripts/
  4. 把 facebox css file 放到 /public/styleshees/
  5. 把 facebox all image files 放到 /public/facebox/
  6. 設定好 layout 的 stylesheet_link_tag 和 javascript_include_tag 加入這些 js,css 檔案

facebox-render 目前放在 github,請下載後放到 vender/plugins/facebox_render

然後在你要使用的 Controller 加入以下程式碼

 include FaceboxRender

或是你直接放到 /app/controllers/application.rb 裡面也是可以。

回到 view code,當你要叫出一個 lightbox :

 facebox_link_to "Login", :url => login_url

或是你也可以用 remote_link_to, remote_form_tag 等Rails內建的 Ajax Helper,差別在於 facebox_link_to 會先秀出一個 Loading lightbox,然後再送 Ajax request。

重頭戲是 action :


def new
 # do some thing you want
 respond_to do |format|
  format.html
  format.js { render_to_facebox }
 end
end

這裡巧妙的運用了 respond_to 來處理 ajax request,預設的 render_facebox 會 render 不帶 layout 的HTML(即 new.html.erb)。當然我們也支援傳入 :action, :template, :partial 等常見的Rails參數,或是乾脆傳入 :html 也可以。

傳入 :msg 的話,會插入一段 <div class=”message”>your msg</div> 到裡面去,方便你做一些提示或警告訊息。

除了 render_facebox,也有 close_facebox 可以關掉 lightbox。也可以用 redirect_from_lightbox 重新讀取另一頁。

實際的應用非常方便,你可以在網頁中用 remote link 或是 remote form submit 叫出 facebox。在 facebox 中也還可以再放 remote link 或 remote form submit,接收處理的 action 可用 render_facebox 或關掉 close_facebox 抑或重新讀取頁面 redirect_from_facebox。

FaceboxRender 的隨附文件請見 README

P.S. 這篇文的英文版在 Handlino’s blog

Rails Front-End 優化

Update(2008/3/24): Yahoo 有份投影片值得一看:

因為 Registrano hosting 在國外的關係,先天速度就慢了一個太平洋。所以如何讓網頁能夠快點 loading 完並且 display 出來變得非常重要且感受明顯。我們可以使用 Firefox 的 YSlow 或 safari web inspector 來檢測實際下載的瓶頸在哪裡。教材則有 O’Reilly High Performance Web Sites 一書值得一讀,裡面的 guideline 有十四點如下:

  1. Make Fewer HTTP Requests
  2. Use a Content Delivery Network
  3. Add an Expires Header
  4. Gzip Components
  5. Put Stylesheets at the Top
  6. Put Scripts at the Bottom
  7. Avoid CSS Expressions
  8. Make JavaScript and CSS External
  9. Reduce DNS Lookups
  10. Minify JavaScript
  11. Avoid Redirects
  12. Remove Duplicates Scripts
  13. Configure ETags
  14. Make Ajax Cacheable

閱讀全文〈Rails Front-End 優化〉