Chrome 預設字體大小為 tiny. 也就是不受限制的縮小,但是今天遇到一位中國同事說 Chrome 安裝後預設最小字體大小被設定為 12px
下圖為我的預設環境

IE6,7 calc 解決方案 expressions
過去支援 IE6, 7, 8 在 CSS 上少了 calc 這個好用的功能實在很不方便,今天才知道原來在 IE7 以前的版本其實是有類似的東西可以解決「expressions」
微軟官方已經表示不再支援 expressions,但在 IE7 前還是可以使用 http://msdn.microsoft.com/en-us/library/ie/dn384050(v=vs.85).aspx
使用方式也與 calc 不太相同,在 expressions 寫的是 javascript,官方給的範例如下:
<DIV ID="oDiv"
STYLE="background-color: #CFCFCF; position: absolute;
left:expression(document.body.clientWidth/2-oDiv.offsetWidth/2);
top:expression(document.body.clientHeight/2-oDiv.offsetHeight/2)">
Example DIV
</DIV>
詳細範例可以參考: http://msdn.microsoft.com/en-us/library/ms537634%28v=vs.85%29.aspx
相關連結 http://msdn.microsoft.com/en-us/library/ie/dn384050(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/ms537634%28v=vs.85%29.aspx
by Isken Huang - 7/15/2014 0 回應 - css, Javascript
nodejs run coffeescript via javascript
CoffeeScript 一直都是我很愛用的語言,但使用上常常需要先 compile 成 javascript 才可以執行,如果是 F2E 的還好,畢竟在出 build 過程中直接 compile 就可以,但 nodejs 上這樣感覺有點怪,能夠直接跑 coffee 當然是最好,好在 CoffeeScript 1.7 後有了這項功能。
首先必須在專案中安裝 CoffeeScript
npm install coffee-script --save
安裝完後在程式進入點如下,其中 './lib/main' 就是 './lib/main.coffee',之後的檔案也就直接使用 CoffeeScript 來撰寫就好
require('coffee-script').register();
require('./lib/main');
相關連結
CoffeeScript
by Isken Huang - 6/07/2014 0 回應 - Javascript, Nodejs
Mac OSX Yosemite window close button
git show commit user and count
github 上有個很酷的圖表是看到所有人的 commit 數量以及增減多少行 code,相同功能在 git 上也有,如同下方的顯示方式可以很清楚的看到所有 commit 數量以及是誰 commit
1266 Isken ******
139 Kyle ******
3 Randy **
只要使用以下指令就可以叫出上方這列表
git shortlog -sn
其中 shortlog 有以下幾個指令可以使用
usage: git shortlog [] [ ] [[--] [ ...]]
-n, --numbered sort output according to the number of commits per author(依照 commit 數量降覓排序)
-s, --summary Suppress commit descriptions, only provides commit count(不顯示 commit 內容,只顯示 commit 數量)
-e, --email Show the email address of each author (顯示 email 來分別不同 user)
-w[] Linewrap output
如果指令改為 -sne 會再加上 email 來判斷為不同人,所以同一個名字可能會出現兩個
git shortlog -sne
1266 Isken ******
216 Isken ******
139 Kyle ******
3 Randy **
如果後面再加上檔案路徑就只會顯示針對這檔案的 commit 數量
資料來源
https://www.kernel.org/pub/software/scm/git/docs/git-shortlog.html

