April 2008 Archives
April 20, 2008
簡易式的三欄式網頁格局
.column {
float: left;
margin-right: 15px;
}
.column.one { width: 200px; }
.column.two { width: 600px; }
.column.three { width: 140px; }
.column.three:after {
content: '.';
clear: both;
visibility: hidden;
}
使用方法就是寫三個 div, 分依次給 class 為 "column one", "column two", "column three",就可以讓他們三欄併列了,實際上的效果正如 opmsg.com。
Labels: css
April 19, 2008
OpenID + Message
最近,利用一些擠出來的時間完成了這個網站: http://opmsg.com/。基本上是做了個 twitter 的原型,只不過在登入的部份,不必申請帳號,而直接採用了 OpenID。
而在人頭圖像 (Avatar) 的部份,也不自已處理,而直接使用了現成的服務: Openvatar。這個服務基本上就是拿 OpenID 來對應到個人圖象。與 Gravatar 或是 MyICON 是一樣的,只是個人的識別字串不是 Email,而是 OpenID。
另外一個完成服務則是 Chatlino,一個互動式聊天室。這個服務其實只算得上是 Chatlino 這個 Handlino Project 的 demo 站,不過基本上聊天的功能都是完備的。還有一些小 bug,不過 shelling++ 最近正在積極的進行重構當中。預計將會有新的 visual design。
關於 OpenID 的基本認識,可以看看 ericsk 所寫的認識 OpenID,而至於 OpenID 怎麼使用,則可以參考 Jeffrey's Note 的這篇文章:如何申請及使用OpenID ! 在 opmsg 與 chatlino 上,只需要打入 openid 網址就行了。目前 Yahoo 與 Google 兩大巨人也直接提供其使用者 OpenID 識別。Yahoo 使用者需要在 http://openid.yahoo.com/上啟用。Google 使用者則可直接用其 Blogger 網址做為 OpenID(不過,如果是使用外部主機做為存放 blog 文章處的話,則無法使用,必需將 blog 站放在 blogger 端才行)。有這兩大後援,無異是替 OpenID 陣營注入了最強的信心以及後援力。
April 13, 2008
OSDC.tw 圓滿結束
以下是我在這 2008 年 OSDC.tw 裡演講所用的投影片。首先是「網頁程式還可以怎麼設計」
然後是 lightning talk 的部份。我總覺得我好像比較適合做 lightning talk。
Labels: javascript, osdc, perl, rails, ruby
April 11, 2008
April 9, 2008
DPCustomMono2 這個字體
由於屬於 Mono 型,DPCustomMono2 這個字體也被列出在 Monospace/Fixed Width Programmer's Fonts 這頁網頁裡面。久久前看到,試了試,覺得這個字體特色很足,筆劃結尾處略重,說不上來倒底是算有無襯線,因為有的字母有,有的無。不過配合其他中文字在 iTerm / Terminal 上使用時,卻不盡理想。
今日又在找字體來欣賞時,再度逛到此字體的頁面,此頁還多了與其他幾種經典標準字體的比較。這才知道原來 DPCustomMono2 的來由,乃是專為 Distributed Proofreaders (DP) 計畫而發明的字體,其用意在讓校讀人能更加容易分辨出錯別字。因此特意設計出筆劃稍微不齊的字型。如下 Arial 般整齊畫一,在字字必看的情境之下,反而容易疲勞:

與 DPCustomMono2 對照如下

似乎是真是有點道理。定睛一看,馬上可以發現在看 Arial 版時,似乎不太能馬上確定倒數第二列第二字的「wlndows」的第二個字母是 L 或是I。一直看到 DPCustomMono2 版時,則立刻可以確定那是小寫 L。
既然了解到這層含意,我決定再度將我 Emacs 的字型設定為 DPCustomMono2 ,看看能不能一定程度上助我找出程式錯誤,或是文件錯誤。
Labels: font
April 8, 2008
"alert here" in Emacs.
When debugging javascript, sometimes it's quite helpful to put alerts. Here's a function for Emacs to insert an alert that shows current file name and line number:
(defun js-insert-alert-at-here ()
(interactive)
(insert (concat "alert(\""
(buffer-name)
": "
(number-to-string (line-number-at-pos))
"\");")))
Labels: debug, emacs, javascript
April 3, 2008
Auto-complete ssh hostname in zsh
compctl -f -k "(
`cat .ssh/known_hosts | perl -lnae '@C=split(",", $F[0]); print for @C'`
)" ssh scp ping
Labels: autocomplete, perl, ssh, zsh
