Permalink
Browse files

新增 readme, 擴充 bad code

  • Loading branch information...
1 parent 44d5111 commit 170945b71e0acb72a60ac2cfcf6dae5bdf132270 @xdite committed Aug 23, 2011
Showing with 711 additions and 37 deletions.
  1. BIN .DS_Store
  2. BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/ie.scssc
  3. BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/print.scssc
  4. BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/rubyconftw.scssc
  5. BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/screen.scssc
  6. BIN .sass-cache/1d8aa3db07720ffbd41ce6b7461fa25fa8bc97a4/_reset.scssc
  7. BIN .sass-cache/3bda273ae1167db8c681ac4d0c35b65945d2d032/_reset.scssc
  8. BIN .sass-cache/43f7c6b2e81259f9e9671279ae9f5f1c9c2a1340/_utilities.scssc
  9. BIN .sass-cache/724a8e4f1c9bf41ba998c29a69300352d4dc2833/_reset.scssc
  10. BIN .sass-cache/cc68b714c1a90de69617ba28e081c40ad837bc40/ie.scssc
  11. BIN .sass-cache/cc68b714c1a90de69617ba28e081c40ad837bc40/print.scssc
  12. BIN .sass-cache/cc68b714c1a90de69617ba28e081c40ad837bc40/screen.scssc
  13. BIN .sass-cache/d2c0c7052f2630646a265a48e656c8574dbd36b6/_utilities.scssc
  14. BIN .sass-cache/e80ff0030fc1b1505cd912f413dc30f2caab65de/_utilities.scssc
  15. +8 −4 about_me/about_me.md
  16. BIN about_me/techbang-logo.png
  17. BIN about_me/techbang.png
  18. +2 −2 agenda/agenda.md
  19. +223 −18 bad_code/bad_code.md
  20. BIN bad_code/book-of-ruby.jpg
  21. BIN bad_code/eloquent-ruby.jpg
  22. BIN bad_code/inconsist-coding-style.png
  23. BIN bad_code/simliar-but-different.png
  24. BIN bad_code/spaghetti.jpg
  25. BIN bad_code/wrong-camel-style.png
  26. BIN bad_code/wrong-coding-style.png
  27. +142 −0 compass_app_log.txt
  28. +24 −0 config.rb
  29. +26 −9 mvc/mvc.md
  30. BIN ruby.png
  31. +66 −4 rubyconftw.css
  32. +5 −0 sass/ie.scss
  33. +3 −0 sass/print.scss
  34. +54 −0 sass/rubyconftw.scss
  35. +6 −0 sass/screen.scss
  36. +5 −0 stylesheets/ie.css
  37. +3 −0 stylesheets/print.css
  38. +76 −0 stylesheets/rubyconftw.css
  39. +68 −0 stylesheets/screen.css
  40. BIN techbang-icon.png
View
BIN .DS_Store
Binary file not shown.
View
BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/ie.scssc
Binary file not shown.
View
BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/print.scssc
Binary file not shown.
View
BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/rubyconftw.scssc
Binary file not shown.
View
BIN .sass-cache/07c439246232fad564fe89c3b8e897fb229dfd19/screen.scssc
Binary file not shown.
View
BIN .sass-cache/1d8aa3db07720ffbd41ce6b7461fa25fa8bc97a4/_reset.scssc
Binary file not shown.
View
BIN .sass-cache/3bda273ae1167db8c681ac4d0c35b65945d2d032/_reset.scssc
Binary file not shown.
View
BIN .sass-cache/43f7c6b2e81259f9e9671279ae9f5f1c9c2a1340/_utilities.scssc
Binary file not shown.
View
BIN .sass-cache/724a8e4f1c9bf41ba998c29a69300352d4dc2833/_reset.scssc
Binary file not shown.
View
BIN .sass-cache/cc68b714c1a90de69617ba28e081c40ad837bc40/ie.scssc
Binary file not shown.
View
BIN .sass-cache/cc68b714c1a90de69617ba28e081c40ad837bc40/print.scssc
Binary file not shown.
View
BIN .sass-cache/cc68b714c1a90de69617ba28e081c40ad837bc40/screen.scssc
Binary file not shown.
View
BIN .sass-cache/d2c0c7052f2630646a265a48e656c8574dbd36b6/_utilities.scssc
Binary file not shown.
View
BIN .sass-cache/e80ff0030fc1b1505cd912f413dc30f2caab65de/_utilities.scssc
Binary file not shown.
View
12 about_me/about_me.md
@@ -1,4 +1,4 @@
-!SLIDE bullets incremental left
+!SLIDE bullets incremental left aboutme
# About Me #
@@ -7,8 +7,12 @@
* http://gplus.to/xdite
* xdite@techbang.com.tw
-!SLIDE
+!SLIDE center
+
+<div class="logo">
+ <img src="techbang-logo.png" />
+</div>
+
+### Lead Developer 兼 Manager
-# T 客邦
-## Lead Developer 兼 Manager
View
BIN about_me/techbang-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN about_me/techbang.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 agenda/agenda.md
@@ -4,6 +4,6 @@
* <del>其實你不會寫 Rails</del>
* 無法理解的 Rails Code
-* 整理 Rails Code
+* 如何整理 Rails Code
* Rails native mechanism
-* 使用 RubyGem 協助你整理程式碼
+* 使用 RubyGem 整理設計程式碼
View
241 bad_code/bad_code.md
@@ -1,30 +1,38 @@
!SLIDE bullets incremental left
-# Concepts
+# <del> 其實你不會寫 Rails </del>
!SLIDE bullets incremental left
-# Newbie's code
+# 常見的 Rails Code
* 晦澀:難以閱讀,無法了解意圖
* 不需要的重複:相同概念的程式碼被複製貼上重複使用
-* 黏滯:彈性不夠,把事情最對比做錯還難
+* 黏滯:彈性不夠,把事情做對比做錯還難
* 固定: 難以分解,讓程式再重用
* 脆弱: 一旦修改,別的無關地方也炸到
* 僵硬 : 難以修改,每改一處牽一髮動全身
-!SLIDE bullets incremental left
+!SLIDE center
# Spaghetti code
-* 不會寫程式就來學習 Rails 。(當然不能看)
-* It just works!
-* 以前是 PHP programmer、.NET Programmer、Java Programmer。(Coding Style 和 Coding Convention 看不懂)
-* 知道太少 Rails Convention。
+<div id="spaghetti">
+ <img src="spaghetti.jpg" />
+</div>
+
+!SLIDE bullets incremental left
+
+# Spaghetti code 的成因
+
+* Don't know how to code
+* IT JUST WORKS!
+* PHP, .NET, JAVA coding tyle
+* unfamiliar with Rails way
!SLIDE bullets incremental left
-# Common Antipattern
+# Common Antipatterns
* 不好的程式寫作習慣
* 不適當的 Coding Style
@@ -33,28 +41,225 @@
* 重複發明輪子
* 濫用 Framework / ORM
-!SLIDE bullets incremental left
+!SLIDE
-# 不好的寫作習慣
+# 使用大量的縮寫
+## 不好的寫作習慣
-* 使用大量的縮寫
-* 濫用 elsif
-* 語意不明(動詞 / 名詞)
-* 濫用自創名詞
-* 類似的 method,變數與寫法不一致。
+!SLIDE code left
-!SLIDE bullets incremental left
+### 無法理解
+
+<div class="wrong">
+<pre>
+ def t_tags
+ t_list.join(" ")
+ end
+</pre>
+</div>
+
+### 容易理解
+
+<div class="correct">
+<pre>
+ def tokenized_tags
+ tag_list.join(" ")
+ end
+</pre>
+</div>
+
+!SLIDE
+
+# 能夠不縮寫就不縮寫
+### 真的太長的 method name ( 3個詞以上),使用 module 或 namespace
+
+!SLIDE
+
+# 濫用 elsif
+## 不好的寫作習慣
+
+!SLIDE code
+
+## 邏輯混亂
+
+<div class="wrong">
+<pre>
+ if color=="red"
+ print "red"
+ elsif color="green"
+ print "green"
+ elsif orignal_color=="yellow"
+ print "yellow"
+ else
+ print "orange"
+ end
+</pre>
+</div>
+
+!SLIDE code
+
+## 容易理解
+
+<div class="correct">
+<pre>
+ if original_color == "yellow"
+ print "yellow"
+ return
+ end
+
+ case color
+ when "red"
+ print "red"
+ when "green"
+ print "green"
+ else
+ print "orange"
+ end
+
+</pre>
+</div>
+
+!SLIDE
+
+# 語意不明
+## 不好的寫作習慣
+
+!SLIDE code
+
+## 動詞 / 名詞 / 形容詞 傻傻搞不清楚
+
+### 錯誤
+
+<div class="wrong">
+ <pre>
+ post.is_hide
+ </pre>
+</div>
+
+### 正確
+
+<div class="correct">
+ <pre>
+ post.is_hidden
+ </pre>
+</div>
+
+!SLIDE code
+
+## 是不是 spam ? => 疑問,回傳 true / false
+
+<div class="correct">
+ <pre>
+ post.is_spam?
+ </pre>
+</div>
+
+## 標記為 spam! => bang,改變狀態
+
+<div class="correct">
+ <pre>
+ post.is_spam!
+ </pre>
+</div>
+
+!SLIDE
+
+# 濫用自創名詞
+## 不好的寫作習慣
+
+!SLIDE code
+
+## 攻 / 受 ( 錯誤示範 )
+
+<div class="wrong">
+ <pre>
+ attacker / defender
+ </pre>
+</div>
+
+## 傳送者 / 接收者 ( 正確示範 )
+
+<div class="correct">
+ <pre>
+ sender / reciever
+ </pre>
+</div>
+
+!SLIDE
+
+## 類似的 method,變數與寫法不一致
+### 不好的寫作習慣
+
+!SLIDE center
+
+### 一下使用 block, 一下使用 lambda
+
+<img src="inconsist-coding-style.png"/>
+
+<br><br>
+
+### 類似的 method,寫法不一致
+
+<img src="simliar-but-different.png" />
+
+!SLIDE
# 不適當的 Coding Style
+!SLIDE center
+
+## 不一致的縮排
+
+ <img src="wrong-coding-style.png" />
+
+!SLIDE center
+
+## method 使用 CamelCase
+
+<img src="wrong-camel-style.png" />
+
+!SLIDE center
+
+## more on...
+
+<img src="book-of-ruby.jpg" />
+
+<br><br>
+## The Book of Weird Ruby
+### 擁有各式各樣奇怪的 Ruby 範例
+
+!SLIDE bullets incremental left
+
+## 正確的 Ruby Coding Style
+
* Use 2 space indent, no tabs.
* Use snake_case for methods.
* Use CamelCase for classes and modules.
* Use SCREAMING_SNAKE_CASE for other constants.
+!SLIDE bullets incremental left
+
+## 正確的 Ruby Coding Style
+
+
+* 大範圍的程式碼使用 do end。1-2 行使用 lambda {}
+* 定義 method 要加括號 ()。除非是宣告或 command
+ - 加括號:hello(name) # 一般 method
+ - 可不加括號: attr_accessible :nickname # 宣告或 command
+
+!SLIDE center
+
+## more on...
+
+<img src="eloquent-ruby.jpg" />
+
+<br><br>
+## Eloquent Ruby
+### 學習寫正確的 Ruby code
+
!SLIDE
-### 如果你的 code 讓人無法閱讀的話,你不是在寫 Ruby Code
+### 如果你的 code 不直觀的話,你不是在寫 Ruby code
!SLIDE
View
BIN bad_code/book-of-ruby.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bad_code/eloquent-ruby.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bad_code/inconsist-coding-style.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bad_code/simliar-but-different.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bad_code/spaghetti.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bad_code/wrong-camel-style.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN bad_code/wrong-coding-style.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
142 compass_app_log.txt
@@ -0,0 +1,142 @@
+2011-08-23 02:50:43 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:50:56 identical stylesheets/rubyconftw.css
+2011-08-23 02:51:00 identical stylesheets/rubyconftw.css
+2011-08-23 02:51:10 identical stylesheets/rubyconftw.css
+2011-08-23 02:52:40 identical stylesheets/rubyconftw.css
+2011-08-23 02:53:05 identical stylesheets/rubyconftw.css
+2011-08-23 02:53:28 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:53:34 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:56:13 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:56:23 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:56:28 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:56:31 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:57:00 identical stylesheets/rubyconftw.css
+2011-08-23 02:57:01 identical stylesheets/rubyconftw.css
+2011-08-23 02:58:15 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:58:19 overwrite stylesheets/rubyconftw.css
+2011-08-23 02:59:06 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:01:32 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:01:47 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:02:19 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:02:22 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:04:32 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:04:49 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:06:34 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:10:05 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:10:12 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:10:18 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:10:35 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:10:59 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:11:03 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:11:17 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:11:31 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:11:57 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:12:02 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:12:21 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:12:56 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:13:00 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:13:32 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:15:28 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:23:31 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:23:35 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:23:43 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:24:09 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:24:34 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:24:41 error sass/rubyconftw.scss (Line 9: Invalid CSS after "...xt align:center": expected "{", was ";}")
+2011-08-23 03:24:41 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:24:50 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:24:56 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:25:04 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:29:28 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:29:43 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:29:51 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:30:03 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:30:08 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:30:21 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:31:39 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:31:58 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:32:11 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:32:56 error sass/rubyconftw.scss (Line 28: Invalid CSS after "}": expected selector or at-rule, was "{list-style-typ...")
+2011-08-23 03:32:56 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:33:02 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:37:46 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:01 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:13 error sass/rubyconftw.scss (Line 23: Invalid CSS after "...0px 40px; lin ": expected "{", was "}")
+2011-08-23 03:40:13 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:20 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:33 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:37 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:42 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:40:52 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:41:04 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:41:37 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:41:41 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:42:33 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:42:41 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:42:46 identical stylesheets/rubyconftw.css
+2011-08-23 03:46:16 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:46:22 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:48:18 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:48:38 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:48:42 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:48:58 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:04 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:08 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:18 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:28 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:40 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:42 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:49:46 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:50:03 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:50:15 overwrite stylesheets/rubyconftw.css
+2011-08-23 03:50:20 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:00:16 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:00:20 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:03:49 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:04:11 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:04:17 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:05:34 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:05:38 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:05:56 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:06:00 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:06:04 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:06:07 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:08:07 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:08:18 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:08:23 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:17:50 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:18:27 error sass/rubyconftw.scss (Line 41: Invalid CSS after "...g-bottom: 20px;": expected "}", was "{")
+2011-08-23 04:18:27 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:18:31 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:19:32 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:19:35 identical stylesheets/rubyconftw.css
+2011-08-23 04:19:43 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:20:01 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:20:22 overwrite stylesheets/rubyconftw.css
+2011-08-23 04:20:34 overwrite stylesheets/rubyconftw.css
+2011-08-23 11:22:44 overwrite stylesheets/rubyconftw.css
+2011-08-23 11:22:55 overwrite stylesheets/rubyconftw.css
+2011-08-23 11:23:07 overwrite stylesheets/rubyconftw.css
+2011-08-23 11:42:10 overwrite stylesheets/rubyconftw.css
+2011-08-23 11:42:13 identical stylesheets/rubyconftw.css
+2011-08-23 11:42:25 identical stylesheets/rubyconftw.css
+2011-08-23 11:42:57 overwrite stylesheets/rubyconftw.css
+2011-08-23 12:01:57 overwrite stylesheets/rubyconftw.css
+2011-08-23 12:02:10 identical stylesheets/rubyconftw.css
+2011-08-23 12:02:19 identical stylesheets/rubyconftw.css
+2011-08-23 12:02:24 overwrite stylesheets/rubyconftw.css
+2011-08-23 12:21:12 overwrite stylesheets/rubyconftw.css
+2011-08-23 12:21:36 overwrite stylesheets/rubyconftw.css
+2011-08-23 12:22:40 overwrite stylesheets/rubyconftw.css
+2011-08-23 12:23:10 overwrite stylesheets/rubyconftw.css
+2011-08-23 14:28:59 error sass/rubyconftw.scss (Line 58: Invalid CSS after "}": expected "}", was "")
+2011-08-23 14:28:59 overwrite stylesheets/rubyconftw.css
+2011-08-23 14:29:06 error sass/rubyconftw.scss (Line 58: Invalid CSS after "}": expected "}", was "")
+2011-08-23 14:29:06 identical stylesheets/rubyconftw.css
+2011-08-23 14:29:16 error sass/rubyconftw.scss (Line 60: Invalid CSS after "}": expected "}", was "")
+2011-08-23 14:29:16 overwrite stylesheets/rubyconftw.css
+2011-08-23 14:29:54 overwrite stylesheets/rubyconftw.css
+2011-08-23 14:30:33 identical stylesheets/rubyconftw.css
+2011-08-23 14:31:00 overwrite stylesheets/rubyconftw.css
+2011-08-23 14:31:21 identical stylesheets/rubyconftw.css
+2011-08-23 14:31:30 overwrite stylesheets/rubyconftw.css
View
24 config.rb
@@ -0,0 +1,24 @@
+# Require any additional compass plugins here.
+
+# Set this to the root of your project when deployed:
+http_path = "/"
+css_dir = "stylesheets"
+sass_dir = "sass"
+images_dir = "images"
+javascripts_dir = "javascripts"
+
+# You can select your preferred output style here (can be overridden via the command line):
+# output_style = :expanded or :nested or :compact or :compressed
+
+# To enable relative paths to assets via compass helper functions. Uncomment:
+# relative_assets = true
+
+# To disable debugging comments that display the original location of your selectors. Uncomment:
+# line_comments = false
+
+
+# If you prefer the indented syntax, you might want to regenerate this
+# project again passing --syntax sass, or you can uncomment this:
+# preferred_syntax = :sass
+# and then run:
+# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
View
35 mvc/mvc.md
@@ -1,27 +1,44 @@
-!SLIDE bullets incremental left
+!SLIDE
-# MVC
-* Model : 用於封裝與 "業務邏輯相關的資料" 以及 "對資料的處理方法"
-* Controller : "控制應用程式的流程"
-* View : 負責資料與介面的呈現
+# Rails => MVC
+## 不要隨意亂扔原始碼
-!SLIDE
+!SLIDE bullets incremental left
+
+# MVC
-## view只是负责数据的呈现,所以我们应该要尽量让view中不涉及业务逻辑的处理。
+* Model
+ - 用於封裝與 「業務邏輯相關的資料」 以及 「對資料的處理方法」
+* Controller
+ - 控制應用程式的流程
+* View
+ - 負責資料與介面的呈現
!SLIDE
-## 分離問題:不要將 UI 邏輯與基礎行為混在一起。
+## View 只負責資料的呈現
+### 不要將 UI 邏輯與基礎行為混在一起
!SLIDE bullets incremental left
-# Antipattern
+# Antipatterns
* LOGIC IN VIEW
* 在 Controller 裡處理資料
* 在 Model 裡寫 view code
+!SLIDE code
+# LOGIC IN VIEW
+
+!SLIDE
+# 在 Controller 裡處理資料
+
+!SLIDE
+
+# 在 Model 裡寫 view code
+
+
!SLIDE
### 道德底線: Maintainability (維護性,容易找到問題)
View
BIN ruby.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
70 rubyconftw.css
@@ -1,14 +1,76 @@
+/* line 1, ../sass/rubyconftw.scss */
body, #preso, .slide {
- background-color: rgb(0,47,73);
+ background-color: black;
color: white;
border: none;
- margin: none;
}
+/* line 8, ../sass/rubyconftw.scss */
.left {
text-align: left;
}
-.left.bullets ul li{
+/* line 12, ../sass/rubyconftw.scss */
+.left.bullets ul li {
text-align: left;
-}
+}
+
+/* line 16, ../sass/rubyconftw.scss */
+#spaghetti {
+ margin-top: 30px;
+}
+/* line 18, ../sass/rubyconftw.scss */
+#spaghetti img {
+ width: 350px;
+ height: 350px;
+}
+
+/* line 25, ../sass/rubyconftw.scss */
+.bullets li {
+ font-size: 36px;
+ padding: 10px 20px 10px 40px;
+ line-height: 1.2em;
+}
+/* line 26, ../sass/rubyconftw.scss */
+.bullets li:before {
+ content: url("/image/ruby.png");
+ padding: 10px 20px 10px 10px;
+}
+/* line 27, ../sass/rubyconftw.scss */
+.bullets li ul {
+ padding-top: 20px;
+}
+/* line 28, ../sass/rubyconftw.scss */
+.bullets li li {
+ font-size: 24px;
+ padding: 10px;
+}
+/* line 29, ../sass/rubyconftw.scss */
+.bullets li li:before {
+ content: '';
+}
+/* line 30, ../sass/rubyconftw.scss */
+.bullets pre + h2 {
+ padding-top: 36px;
+}
+
+/* line 33, ../sass/rubyconftw.scss */
+.correct {
+ color: green;
+}
+
+/* line 37, ../sass/rubyconftw.scss */
+.wrong {
+ color: red;
+}
+
+/* line 43, ../sass/rubyconftw.scss */
+.code pre {
+ font-size: 2em;
+ line-height: 1.5em;
+}
+
+/* line 49, ../sass/rubyconftw.scss */
+div.image {
+ text-align: center;
+}
View
5 sass/ie.scss
@@ -0,0 +1,5 @@
+/* Welcome to Compass. Use this file to write IE specific override styles.
+ * Import this file using the following HTML or equivalent:
+ * <!--[if IE]>
+ * <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
+ * <![endif]--> */
View
3 sass/print.scss
@@ -0,0 +1,3 @@
+/* Welcome to Compass. Use this file to define print styles.
+ * Import this file using the following HTML or equivalent:
+ * <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */
View
54 sass/rubyconftw.scss
@@ -0,0 +1,54 @@
+body, #preso, .slide {
+ // background-color: rgb(0,47,73);
+ background-color: black;
+ color: white;
+ border: none;
+}
+
+.left {
+ text-align: left;
+}
+
+.left.bullets ul li{
+ text-align: left;
+}
+
+#spaghetti{
+ margin-top: 30px;
+ img{
+ width: 350px;
+ height: 350px;
+ }
+}
+
+.bullets{
+ li { font-size: 36px; padding: 10px 20px 10px 40px; line-height: 1.2em; }
+ li:before { content: url("/image/ruby.png"); padding: 10px 20px 10px 10px; }
+ li ul { padding-top: 20px;}
+ li li { font-size: 24px; padding: 10px;}
+ li li:before { content: ''; }
+ pre + h2 { padding-top: 36px; }
+}
+
+.correct{
+ color: green;
+}
+
+.wrong{
+ color: red;
+}
+
+.code{
+
+ pre{
+ font-size: 2em;
+ line-height: 1.5em;
+ }
+}
+
+div.image{
+ text-align:center;
+}
+
+
+
View
6 sass/screen.scss
@@ -0,0 +1,6 @@
+/* Welcome to Compass.
+ * In this file you should write your main styles. (or centralize your imports)
+ * Import this file using the following HTML or equivalent:
+ * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
+
+@import "compass/reset";
View
5 stylesheets/ie.css
@@ -0,0 +1,5 @@
+/* Welcome to Compass. Use this file to write IE specific override styles.
+ * Import this file using the following HTML or equivalent:
+ * <!--[if IE]>
+ * <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
+ * <![endif]--> */
View
3 stylesheets/print.css
@@ -0,0 +1,3 @@
+/* Welcome to Compass. Use this file to define print styles.
+ * Import this file using the following HTML or equivalent:
+ * <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */
View
76 stylesheets/rubyconftw.css
@@ -0,0 +1,76 @@
+/* line 1, ../sass/rubyconftw.scss */
+body, #preso, .slide {
+ background-color: black;
+ color: white;
+ border: none;
+}
+
+/* line 8, ../sass/rubyconftw.scss */
+.left {
+ text-align: left;
+}
+
+/* line 12, ../sass/rubyconftw.scss */
+.left.bullets ul li {
+ text-align: left;
+}
+
+/* line 16, ../sass/rubyconftw.scss */
+#spaghetti {
+ margin-top: 30px;
+}
+/* line 18, ../sass/rubyconftw.scss */
+#spaghetti img {
+ width: 350px;
+ height: 350px;
+}
+
+/* line 25, ../sass/rubyconftw.scss */
+.bullets li {
+ font-size: 36px;
+ padding: 10px 20px 10px 40px;
+ line-height: 1.2em;
+}
+/* line 26, ../sass/rubyconftw.scss */
+.bullets li:before {
+ content: url("/image/ruby.png");
+ padding: 10px 20px 10px 10px;
+}
+/* line 27, ../sass/rubyconftw.scss */
+.bullets li ul {
+ padding-top: 20px;
+}
+/* line 28, ../sass/rubyconftw.scss */
+.bullets li li {
+ font-size: 24px;
+ padding: 10px;
+}
+/* line 29, ../sass/rubyconftw.scss */
+.bullets li li:before {
+ content: '';
+}
+/* line 30, ../sass/rubyconftw.scss */
+.bullets pre + h2 {
+ padding-top: 36px;
+}
+
+/* line 33, ../sass/rubyconftw.scss */
+.correct {
+ color: green;
+}
+
+/* line 37, ../sass/rubyconftw.scss */
+.wrong {
+ color: red;
+}
+
+/* line 43, ../sass/rubyconftw.scss */
+.code pre {
+ font-size: 2em;
+ line-height: 1.5em;
+}
+
+/* line 49, ../sass/rubyconftw.scss */
+div.image {
+ text-align: center;
+}
View
68 stylesheets/screen.css
@@ -0,0 +1,68 @@
+/* Welcome to Compass.
+ * In this file you should write your main styles. (or centralize your imports)
+ * Import this file using the following HTML or equivalent:
+ * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
+/* line 17, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+/* line 20, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+body {
+ line-height: 1;
+}
+
+/* line 22, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+ol, ul {
+ list-style: none;
+}
+
+/* line 24, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+/* line 26, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+caption, th, td {
+ text-align: left;
+ font-weight: normal;
+ vertical-align: middle;
+}
+
+/* line 28, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+q, blockquote {
+ quotes: none;
+}
+/* line 101, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+q:before, q:after, blockquote:before, blockquote:after {
+ content: "";
+ content: none;
+}
+
+/* line 30, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+a img {
+ border: none;
+}
+
+/* line 114, ../../../../../../Applications/compass.app/Contents/Resources/ruby/compass_0.11/compass-0.11.5/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
+article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary {
+ display: block;
+}
View
BIN techbang-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 170945b

Please sign in to comment.