網頁

2012年5月27日 星期日

[jQuery] 30種不同的 jQuery Tooltip



2012年5月17日 星期四

[ROR] rails 轉換 HTMLEntities

今天在轉換資料從 MSSQL (BIG5 編碼) to  MySql (UTF8)

遇到文字內有      ♥     等 HTMLEntities

在 MSSql 需要 encode 才能儲存

但現在 MySql 已經可以一直接存放    = ♥

在Ruby 有好用的gme 可以直接轉換

HTMLEntities

https://github.com/threedaymonk/htmlentities


範例


Decoding

require 'htmlentities'
coder = HTMLEntities.new
string = "élan"
coder.decode(string) # => "élan"

Encoding

This is slightly more complicated, due to the various options. The encode method takes a variable number of parameters, which tell it which instructions to carry out.
require 'htmlentities'
coder = HTMLEntities.new
string = "<élan>"
Escape unsafe codepoints only:
coder.encode(string) # => "&lt;élan&gt;"
Or:
coder.encode(string, :basic) # => "&lt;élan&gt;"

2012年5月14日 星期一

[MAC] 如何讓MAC顯示隱藏檔


1 啟用顯示隱藏檔
    在終端機下輸入指令"defaults write com.apple.finder AppleShowAllFiles -bool true",然後強制重新啟動Finder(左上角小蘋果圖示-->強制結束-->選擇"Finder")

2 關閉顯示隱藏檔
    在終端機下輸入指令"defaults write com.apple.finder AppleShowAllFiles -bool false",然後強制重新啟動Finder即可(左上角小蘋果圖示-->強制結束-->選擇"Finder")

LinkWithin

Related Posts with Thumbnails