Wednesday, October 1, 2014

My Recent Works

Here are my recent works:





flkrshare - A flickr sharing urls generator.(Link)


The flkrshare application is a flickr sharing urls generator.

It starts from getting a valid flickr user. Flickr will ask for the permission to read the original size of the photos and then show all photosets owned by the user. It will generate the sharing urls of all photos after user choose one photoset. The users just copy the sharing urls, paste to their blog html editors and starts to write article.

The Techniques used:
  • flickr APIs wrapped by flickraw
  • Bootstrap 3 for responsive web design
Steps to operate:
  1. input a valid flickr user name.
  2. give permission on flickr page.
  3. select the photoset.
  4. review the photos.
  5. generate the sharing urls.

Project source repo at Github: https://github.com/chaoyee/flkrshare






MyFlix - A production quality video web site(Link)


MyFlix is the example of showing the professional capability of a Ruby on Rails developer.

Several key points such as:
- TDD (Test Driven Development) and Agile development practice.
- Social networking features.
- Administration features such as adding videos.
- Background jobs for asynchronous processing of emails (Sidekiq).
- A third-party e-commerce system integration of wrapping APIs, credit card payment and recurring billing for customers (stripe.com).
- Users can watch video clips, leave reviews and invite friends to join the site.

Project source repo at Github: https://github.com/chaoyee/myflix
Demo site: http://myflixch.herokuapp.com/





PostIt! - A mini posting system to post interesting links on it(Link)


- A mini posting system that allows people to post some interesting things or thoughts on it.
- The users can have comments to the post.
- Everybody can do a positive or negative vote to both posts and comments.
- The users who want to post, comment or vote must register to the system.
- Only the user with admin role can manage the system such as creating categories.

Project source repo at Github: https://github.com/chaoyee/PostIt
Demo site: http://postitch.herokuapp.com/


Monday, June 30, 2014

Making a Flickr sharing utility using Flickr API

Flickr is a well-known photo sharing service. I have used it since 2006. It’s a stable, easy to use and powerful site for sharing my photography. Further more, I used Flickr as a photo bed to serve the photos to my blog site. It’s a perfect match for saving space of my blog web site as well as better performance.

Since I am a photographer, I always like to put many photos in one article. That make me feel troublesome since I have to copy the shared urls of each photo and paste it to the html file of the article manually. If I have 20 photos in that photoset, I have to do it 20 times. It’s really a nightmare.

Therefore, I decide to find some utilities to help me do the job. I have found quickr pickr is quite helpful which can generate a HTML file from the selected photos. However, I can not find a way to select photos from a certain photoset. I decide to build my own utility web to solve this problem.

Firstly, I visit Flickr API web site to study how to utilize the Flickr APIs. I also found some gems of Ruby wrapper such as flickr_fu, flickraw and more. I tried flickr_fu first because I found this article “Integrating Flickr into your rails website”. There are detailed explainations of how to use the wrapper and get the photos shown on the web pages. However, I got stuck while I tried to call the wrapper. There was a message: “95: SSL is required, SSL is required to access the Flickr API.” It is because of this article on the Flickr Blog: “Flickr API Going SSL-Only on June 27th, 2014”. Flickr API does not allow non-SSL connections any more. Well, flickr_fu is not support SSL. It is time to change another wrapper.

“flickraw” is quite promising since it supports SSL. I found it is extremly easy to use. Also, developers can save times because there are many handy helpers to use.
After a hard working time, flkrshare is releasing!

The flkrshare application is a flickr sharing urls generator.

It starts from getting a valid flickr user. Flickr will ask for the permission to read the original size of the photos and then show all photosets owned by the user. It will generate the sharing urls of all photos after user choose one photoset. The users just copy the sharing urls, paste to their blog html editors and starts to write article.

The Techniques used:

  • flickr APIs wrapped by flickraw
  • Bootstrap 3 for responsive web design

Steps to operate

  1. input a valid flickr user name.
  2. give permission on flickr page.
  3. select the photoset.
  4. review the photos.
  5. generate the sharing urls.

App on Heroku

http://flkrshare.herokuapp.com/

Thursday, May 22, 2014

How to write better rspec tests

It is a great issue of writing rspec tests because it needs a lot of practice to get used to it for a new programmer. I have found a guide for a better rspec writing: “Pro tips for writing better rspec tests” written by Josh Software. These giidences are quite easy to realize and follow. Sample codes are also provided as reference.
There are ten tips as follows:
  1. Follow Rspec style guide
  2. Independent tests
  3. Use expect and not should syntax
  4. Use the new syntax for object creation
  5. Use let variables instead of instance variables
  6. Use correct expectations for a spec
  7. Use shared examples
  8. Use conditional hooks
  9. Profiling your examples
  10. Tagging
For the document “Rspec style” on Githib, it must be read and followed first. it is the basic guide for rspec test. I see no reason why you didn’t study this guide before starting to write rspec tests.

< Traditional Chinese 繁體中文>
撰寫 rspec 測試是一件大工程,對新手而言,必須有大量的練習才能夠熟悉它。我剛好找到有一篇如何撰寫好的rspce tests的文章: “寫好rspec測試的專業訣竅 (Pro tips for writing better rspec tests)” 由 Josh Software撰寫。這些指引是非常容易了結及遵循的,也包含參考用的範例程式碼。
文中提供十個訣竅:
  1. 遵循 Rspec樣式 指引
  2. 獨立測試
  3. 使用 expect 而非 should 語法
  4. 建立物件時使用新語法
  5. 使用 let 變數來取代實例變數(instance variable)
  6. 對規格使用正確的期待值
  7. 使用 shared examples
  8. 使用條件式掛勾
  9. 對 examples 加以剖析
  10. 標記
對於在 Github 上的 Rspec style 文件,我們必須先要詳讀以及遵循,它是 rspec test 的基本指引。我覺得在你開始撰寫 rspec test 之前,沒有理由不先詳加閱讀。