From aec7c8f0c5ae4022b0114f9da1483c10fa58b88e Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Wed, 4 Jun 2014 15:14:41 +0800 Subject: [PATCH] Update. --- css-antialias.md | 23 +++++++++++++ css-flexbox.md | 21 +++++++++++- css.md | 3 +- rails-helpers.md | 81 +++++++++++++++++++++++++++++++-------------- rails-i18n.md | 15 +++++++++ rails-migrations.md | 15 +++++++++ sh.md | 5 ++- 7 files changed, 134 insertions(+), 29 deletions(-) create mode 100644 css-antialias.md diff --git a/css-antialias.md b/css-antialias.md new file mode 100644 index 000000000..62de06bab --- /dev/null +++ b/css-antialias.md @@ -0,0 +1,23 @@ +--- +title: CSS antialiasing +layout: default +--- + +### On + + * { + text-rendering: optimizeLegibility !important; + -webkit-font-smoothing: antialiased !important; + -moz-osx-font-smoothing: grayscale; + } + +### Support + + * Firefox 25+ on OSX + * Webkits (Chrome, Safari, etc) + +### References + + * [maxvoltar.com](http://maxvoltar.com/archive/-webkit-font-smoothing) + * [maximilianhoffman.com](http://maximilianhoffmann.com/posts/better-font-rendering-on-osx) + * [ilikekillnerds.com](http://ilikekillnerds.com/2010/12/a-solution-to-stop-font-face-fonts-looking-bold-on-mac-browsers/) diff --git a/css-flexbox.md b/css-flexbox.md index 7b6d4fe5d..b9514a8b9 100644 --- a/css-flexbox.md +++ b/css-flexbox.md @@ -10,7 +10,9 @@ Basic } .container > div { - flex: 0 1 auto; /* grow shrink basis */ + flex: 0 0 40px; + flex: 0 1 auto; + /* grow shrink basis */ } Full @@ -54,3 +56,20 @@ Full height: 100px; margin: auto; } + +### Mobile + + .container { + display: flex; + flex-direction: column; + } + + .container > .top-bar { + flex: 0 0 100px; + } + + .container > .content { + height: 100px; + flex: 1 0 auto; + } + diff --git a/css.md b/css.md index 81f07e0bb..17bd62ae9 100644 --- a/css.md +++ b/css.md @@ -66,6 +66,7 @@ Animations # Example: animation: bounce 300ms linear 0s infinite normal animation: bounce 300ms linear infinite + animation: bounce 300ms linear infinite alternate-reverse ### Other properties @@ -80,8 +81,6 @@ Webkit extensions /* maxvoltar.com/archive/-webkit-font-smoothing */ * { - text-rendering: optimizeLegibility !important; - -webkit-font-smoothing: antialiased !important; text-rendering: optimizeLegibility !important; -webkit-font-smoothing: antialiased !important; -moz-osx-font-smoothing: grayscale; diff --git a/rails-helpers.md b/rails-helpers.md index d63980df2..68f76e22e 100644 --- a/rails-helpers.md +++ b/rails-helpers.md @@ -3,14 +3,36 @@ title: Rails helpers layout: default --- -### Date helpers - -http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html - ### Date distance_of_time_in_words(Time.now, project.end_date) #=> 3 hours - distance_of_time_in_words_to_now project.end_date #=> 3 hours + distance_of_time_in_words_to_now(project.end_date) #=> 3 hours + + time_ago_in_words 3.minutes.ago #=> "3 minutes" + +### Numbers + + number_to_currency 20.33 + number_with_precision 3.14159, precision: 2 + number_to_percentage 32 #=> "32%" + number_with_delimiter 2048 #=> "2,048" + number_to_human 12000000 #=> "12 million" + number_to_human_size 12000000 #=> "12 MB" + number_to_phone "5551234" #=> "555-1234" + +### Cache + + <% cache project do %> + <% cache [project, current_user] do %> + + <% cache_if admin?, project do %> + <% cache_unless admin?, project do %> + +### Tags + + tag("br") + tag("img", src: "image.jpg") + content_tag(:p, "Hello") ### Time select @@ -20,38 +42,43 @@ http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html # All options are optional time_select "article", "start_time", \ - :include_seconds => true, - :minute_step => 15, - :prompt => true, - :prompt => { :hour => "Choose hr", :minute => "Choose min", :second => "Choose sec" }, - :ampm => true + include_seconds: true, + minute_step: 15, + prompt: true, + prompt: { hour: "Choose hr", minute: "Choose min", second: "Choose sec" }, + ampm: true # For dates (all options are optional) date_select "article", "written_on", \ - :start_year => 1995, - :use_month_numbers => true, - :discard_day => true, - :include_blank => true, - :order => [:day, :month, :year], - :default => 3.days.from_now, - :default => { :day => 20 }, - :prompt => { :day => 'Select day', :month => 'Select month', :year => 'Select year' } + start_year: 1995, + use_month_numbers: true, + discard_day: true, + include_blank: true, + order: [:day, :month, :year], + default: 3.days.from_now, + default: { day: 20 }, + prompt: { day: 'Select day', month: 'Select month', year: 'Select year' } ### Time tag - time_tag Date.today #=>