2010年11月8日 星期一

IE8 X-UA-Compatible重繪問題

IE8在讀到舊版的css之後會造成重繪問題。本來這樣設定在第一次讀取的之後還是錯誤的,然後再次讀取(重新整理)之後就正確。
<head>
…
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<style type="text/css">…</style>
</head>

測試出來的解法為,在呼叫Style的前面和後面都用這個語法包上。
<head>
…
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<style type="text/css">…</style>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
</head>
如此一來,在讀到舊版的時候就會是正確的

自己想到可能的原因有,style設定檔是內崁入html,在呼叫的時候的順序問題(?),所以用此方法可以解決。

而且,這個方法若移除上方的那個,依舊是錯誤

當然!最好的辦法是重新寫過CSS,不這就不在這篇的分享範圍裡了 XD

2010年10月18日 星期一

Keep Focused 自行修改版

Keep Focused 這個好用的小工具一直有一些問題,在找到原始出處後,就自己動手把他修了一下,並且把修完的patch也回給作者

功能依舊很簡單,若我做的版本有什麼問題,也請在這裡回報給我

自己修正的原始碼在這

更新內容:
  • 新增最後視窗位置儲存於設定檔
  • 新增改變TaskList路徑
  • 當休息5分鐘結束後,顯示提示訊息
  • 修正工作清單未正確存入檔案之問題 [beta 2]
  • 視窗重新配制設計 [0.3.3]
  • 增加正體中文支援 [0.3.3]
主程式檔案下載 這裡 分流
中文版檔案下載 這裡 分流
PS.中文版內有zh-TW這個資料夾,跟主程式放在同一目錄下即可

2010年10月1日 星期五

[Mac]多帳號同時登入 Dropbox

# 建立一個新的.dropbox目錄,存另一個帳號的資料
# Make another .dropbox dir to save data
HOME=/Users/$USER/.dropbox-alt
/Applications/Dropbox.app/Contents/MacOS/Dropbox
# Make another dropbox app
mkdir -p /Users/$USER/Applications/DropboxAltStarter.app/Contents/MacOS/
cat > /Users/$USER/Applications/DropboxAltStarter.app/Contents/Info.plist << EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleExecutable</key>
<string>DropboxAltStarter</string>
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>
EOF
cat > /Users/$USER/Applications/DropboxAltStarter.app/Contents/MacOS/DropboxAltStarter << EOF
#!/bin/bash
# Assumes you have Dropbox in /Applications
HOME=/Users/$USER/.dropbox-alt /Applications/Dropbox.app/Contents/MacOS/Dropbox
EOF
chmod 755 /Users/$USER/Applications/DropboxAltStarter.app/Contents/MacOS/DropboxAltStarter
view raw make-dropbox.sh hosted with ❤ by GitHub


2010年9月26日 星期日

找出類型為檔案並變更其權限

find . -type f -print -exec chmod -x '{}' \;

註:ecec的結尾一定要是'\;'

2010年9月25日 星期六

把兩個遠端git合併成一個再push回去

會做這件事除了練習git remote之外,當做是一種技巧。

這次主要是把自己寫的vimrcgvimrc和併成一個(成果合併在vimrc這個裡面了)

過程如下:
# 把主要的那個clone下來
git clone git@gist.github.com:171579.git my_vimrc
# 移到目標目錄
cd my_vimrc
# 新增一個新的遠端連接點並tag為gvimrc
git remote add gvimrc git@gist.github.com:171581.git
# 抓取gvimrc內容
git fetch
# 建一個新的branch命名為gvimrc並把遠端指到這個gvimrc
git checkout -b gvimrc gvimrc/master
# 換回master
git checkout master
# 合併gvimrc到master
git merge gvimrc
# 把合併的結果push出去,這會push到vimrc這個
git push

參考文件:

2010年9月20日 星期一

Mac OSX 下專用的 Git ignore file

設定家目錄下的.gitignore為通用設定檔
git config --global core.excludesfile ~/.gitignore

參考一些Xode的暫存檔更新後,內容如下
# Mac OS X Finder and whatnot
.DS_Store
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# no useful files
log/*.log
tmp/**/*
public/cache/**/*
doc/api
doc/app
# Xcode
build/*
*.o
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xcworkspace
!default.xcworkspace
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap
# Other source repository archive directories (protects when importing)
.hg
.svn
CVS
# automatic backup files
*~.nib
*.swp
*~
*(Autosaved).rtfd/
Backup[ ]of[ ]*.pages/
Backup[ ]of[ ]*.key/
Backup[ ]of[ ]*.numbers/
# Sparkle distribution Private Key (Don't check me in!)
dsa_priv.pem
## android use
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
# generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Eclipse project files
.classpath
.project
# Proguard folder generated by Eclipse
proguard/
# Intellij project files
*.iml
*.ipr
*.iws
.idea/
# ctags
TAGS
# Cocoapods
Pods/
podfile.lock
view raw Darwin hosted with ❤ by GitHub
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
[Bb]in
[Dd]ebug*/
*.lib
*.sbr
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
view raw Visual Studio hosted with ❤ by GitHub
#ignore thumbnails created by windows
Thumbs.db
view raw Windows hosted with ❤ by GitHub

若有興趣的可以用git抓取原始碼

PS.原來gist也能用git回來或是push回去阿,實在是太有趣了 XD

2010年9月17日 星期五

把iTunes 10的圖示從直式換回橫式

在終端機執行重開即可
defaults write com.apple.iTunes full-window -1

2010年9月14日 星期二

用homebrew裝git+svn

預設定的git沒有git-svn的功能,在這篇文章查到方法
brew install git --with-svn

2010年8月19日 星期四

更新syntaxhighlighter到3.0.83

基於很久沒有更新,順手直接把server上2.x版的換掉,目前看來都是好的!

Great!!
如此順利真好!

2010年8月7日 星期六

Mac上自製靜音按鈕

系統預設裡面找不到靜音的熱鍵,只好自製

功能很簡單,若已經是靜音的狀態再執行一次就會回復
tell application "System Events"
if (output muted of (get volume settings)) is true then
set volume without output muted
else
set volume with output muted
end if
end tell
view raw mute.scpt hosted with ❤ by GitHub