2014年5月16日 星期五

bootstrap color

2014年5月15日 星期四

javascript day issue


when I want to show the date fetch from backend, I realised that its one day off. ex. the date is 2014/5/15, however it shows 2014/5/14.

The problem is datestring

reference:
http://stackoverflow.com/questions/9509360/datepicker-date-off-by-one-day

console.log(new Date('2012-03-21')); //prints Tue Mar 20 2012 20:00:00 GMT-0400 (Eastern Daylight Time)
The Javascript Date object can accept one of the following syntax as below,
  1. new Date()
  2. new Date(milliseconds)
  3. new Date(dateString)
  4. new Date(year, month, day [, hour, minute, second, millisecond ])
So in your case it is going to call the dateString and parse. So try appending the time as below,
new Date ('2012-03-21T00:00:00') //should return you Wed Mar 21 2012
or Better to use as below,
new Date (2012, 2, 21). 
year - Integer value representing the year. For compatibility (in order to avoid the Y2K problem), you should always specify the year in full; use 1998, rather than 98.
month - Integer value representing the month, beginning with 0 for January to 11 for December.
day - Integer value representing the day of the month (1-31).



2014年5月14日 星期三

rails turbolink

If you want to disable Turbolinks for certain links, add a data-no-turbolink attribute to the tag:
<a href="..." data-no-turbolink>No turbolinks here</a>.

2014年5月3日 星期六

html

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/HTML5_element_list


2014年5月2日 星期五

bootstrap Responsive Utilities

template

http://startbootstrap.com/all-templates

Responsive Utilities

Just like Bootstrap 2, Bootstrap 3 provides responsive utilities for hiding and showing elements based on the browser size. This will also help us in defining our grid system.
  • .visible-xs
  • .visible-sm
  • .visible-md
  • .visible-lg
  • .hidden-xs
  • .hidden-sm
  • .hidden-md
  • .hidden-lg

git


http://tech.marsw.tw/blog/2013/08/16/git-notes-github


1.第一次初始
在Github開repo
git clone [clone URL] 先把code從Github抓下來
2.
進到該目錄中
git branch [branch-name] 生一個新branch
git checkout [branch-name] 切換到此branch上
3.
git status 看修改了哪些檔案
git add [修改到的檔案] 一個檔一個檔自己加,因為這樣可以Double check自己到底改了哪些檔
git commit 註解要寫清楚 完成一個小功能就要commit一次
重複步驟3.直到 git status 顯示沒有任何修改過的檔案
4.
git checkout master
git merge [branch-name] 和master merge起來
git push 然後接著輸入Github的帳號密碼

push to heoku

 git push heroku master

rails command line

  • rails console
  • rails server
  • rake
  • rails generate
  • rails dbconsole
  • rails new app_name
$ rails console --sandbox

$ rails destroy model Oops
$ rake about


You can precompile the assets in app/assets using rake assets:precompile and remove those compiled assets using rake assets:clean.
rake routes


rails foo

Creates a new Rails applications in subdirectory foo.
rake db:migrate
Runs all migrations to bring the database up to date.
rake db:migrate:reset
Drops the database, creates a new one, and runs all migrations to bring the database up to date.
rake db:migrate VERSION=20090909201633_create_photos.rb
Runs migrations (either forward or backward) to restore the database to match the state just after the given migration.
gem update
Updates all Ruby Gems.
gem update rails--include-dependencies
Updates Rails to the latest version, including all Gems that Rails depends upon.
gem update --system
Updates Ruby to the latest version.


bundle exec gem uninstall GEM_NAME

---------using bundle

undle clean(1)
Cleans up unused gems in your bundler directory
bundle show(1)
Show the source location of a particular gem in the bundle


bundle install(1)
Install the gems specified by the Gemfile or Gemfile.lock
bundle update(1)
Update dependencies to their latest versions