2013年11月21日 星期四

Backup your Xcode snippet

Xcode snippet介紹

http://nshipster.com/xcode-snippets/

備份自己的snippet

首先Fork https://github.com/mneorr/snippie 到自己的repository,然後

git clone https://github.com/*******/snippie.git xcode-snippets

星號部分請代換成自己的使用者名稱

cd xcode-snippets 
bundle install
rake backup 

然後Push到github上,這樣就完成初次的備份了。你可以在自己的snippie fork上看到指令列表。

匯入之前備份的snippet

如果之後換新電腦,這些備份的snippet就可以派上用場了。只要把snippet從git上clone下來,然後

rake import

就成功匯入Xcode了

匯入別人的code snippet

知名的Objective-C開發者Mattt Thompson分享了他的snippet,就用這個來當練習吧。
https://github.com/mattt/Xcode-Snippets
git clone下來之後把全部的.m檔都放到readable_snippets資料夾底下。 但是snippie的rake import只吃.codesnippet檔,所以要先把.m檔轉換成.codesnippet。 好險有熱心網友做了一個ruby script幫助我們做這件事。 https://gist.github.com/subdigital/4463440#file-convert_to_codesnippet-rb
首先把這個gist載到readable_snippets資料夾底下。 然後下指令

find ./*.m -type f -maxdepth 1 -exec ruby ./convert_to_codesnippet.rb {} \;

注意:若有cannot load such file -- nokogiri-plist的錯誤就是缺少plist gem 必須gem install nokogiri-plist才能順利執行。
接下來

cp ./*.codesnippet ../backup/
rake import
rm -rf ./*.codesnippet

現在重新打開Xcode,就可以看到新增的snippet囉。 然後再次做備份 rake backup 再上傳到github,就完成這次的匯入工作了。

2013年11月18日 星期一

開發者選擇到哪個城市過活?

前一陣子看到罗马尼亚程序员的幸福生活這篇文章,我開始好奇如果台灣iOS開發者選擇出走,到國外是否能獲得更好的生活品質?
在文章裡有提供一個網站numbeo比較城市之間消費與收入訊息。

美國加州San Francisco 與台北的比較

You would need around 6,038.47(178,738.69NT) in San Francisco, CA to maintain the same standard of life that you can have with 83,000.00NT$ in Taipei (assuming you rent in both cities). This calculation uses our Consumer Prices Including Rent Index.

如果要在San Francisco達到在台北有83,000 NTD月薪的生活水準,必須要有6,000 USD的月薪,也就是72,000 USD的年薪。
再看Indeed的資料,iOS developer在San Francisco的平均年薪大約座落在121,000 USD左右,根據網路上找到的加州税后工资与税前收入对照表,稅後收入約84,000 USD。聽起來很美好,但是願意幫忙申請工作簽證的公司似乎不好找就是。

荷蘭阿姆斯特丹與台北的比較

You would need around 3,706.02€ (147,921.12NT) in Amsterdam to maintain the same standard of life that you can have with 83,000.00NT$ in Taipei (assuming you rent in both cities). This calculation uses our Consumer Prices Including Rent Index.

如果要在Amsterdam達到在台北有83,000 NTD月薪的生活水準,必須要有3,700 EUR的月薪,也就是44,400 EUR的年薪,換算成美金大約是59,928 USD。 iOS developer在阿姆斯特丹的平均年薪大概在95,000 USD左右,稅後為55,100 USD。但是從網路上的心得分享來看,在荷蘭的工作較為穩定,加班時數較少。順便附上荷蘭的稅率計算方式