Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MUGEN MEET UP #1

MUGEN MEET UP #1

Kuranari Tomohisa

October 07, 2015
Tweet

More Decks by Kuranari Tomohisa

Other Decks in Programming

Transcript

  1. ͓඼ॻ͖ 1. 10 Most Common Rails Mistakes: 
 A Best

    Practice Tutorial 2. Gr8 — A great utility brings Ruby power to your command-line. 3. Typeset.js
  2. 10 Most Common Rails Mistakes: A Best Practice Tutorial •

    RailsͷΞϯνύλʔϯΛ10ݸ঺հ • ౰ͨΓલͷ͜ͱͳΜ͚ͩͲɺ΄΅શͯ౿Έൈ ͍͍ͯͨ .PTU$PNNPO3BJMT.JTUBLFT"#FTU1SBDUJDF5VUPSJBM IUUQXXXUPQUBMDPNSVCZPOSBJMTUPQNJTUBLFTUIBUSBJMTQSPHSBNNFSTNBLF
  3. 10 Most Common Rails Mistakes: A Best Practice Tutorial 1.

    ίϯτϩʔϥʹϩδοΫΛॻ͖͗͢ Putting too much logic in the controller 2. ϏϡʔʹϩδοΫΛॻ͖͗͢ Putting too much logic in the view 3. ϞσϧʹϩδοΫΛॻ͖͗͢ Putting too much logic in the view 4. ϔϧύʔΛഇغ৔ॴͱͯ͠࢖͏ Using generic helper classes as a dumping ground
  4. 10 Most Common Rails Mistakes: A Best Practice Tutorial 5.

    Gem࢖͍͗͢ Using too many gems 6. ϩάग़ྗΛແࢹ͢Δ Ignoring your log files 7. ςετෆ଍ Lack of automated tests
  5. 10 Most Common Rails Mistakes: A Best Practice Tutorial 8.

    ֎෦αʔϏεΛಉظݺͼग़͢͠Δ Blocking on calls to external services 9. migrationϑΝΠϧʹґଘ͢Δ Getting married to existing database migrations 10.ػີ৘ใΛϦϙδτϦʹίϛοτ͢Δ Checking sensitive information into source code repositories
  6. #1 ίϯτϩʔϥʹϩδοΫ
 ॻ͖͗͢ • Controllerʹॻ͍͍͍ͯॲཧ • ηογϣϯͱΫοΩʔͷ؅ཧ • Ϟσϧͷऔಘ •

    ϦΫΤετύϥϝʔλͷ؅ཧ • ϨϯμϦϯάͱϦμΠϨΫτ • ίϯτϩʔϥΛଠΒͤͳ͍ʂ
  7. Gr8 — A great utility brings Ruby power to your

    command-line. • RubyͷArrayૢ࡞ΛίϚϯυϥΠϯ͔Β΋࢖͑ Δ(࢖͍΍͘͢)Α͏ʹͨ͠΋ͷ map, select, inject, grep, min, max (SIUUQLXBUDIHJUIVCJPHS $ gem install gr8
  8. Gr8 — map $ cat data Haruhi 100 Mikuru 80

    Yuki 120 $ cat data | gr8 'map{|s| s }' Haruhi 100 Mikuru 80 Yuki 120
  9. Gr8 — split, inject # Split $ cat data |

    gr8 'map{|s| s.split()[1] }' 100 80 120 # inject $ cat data | > gr8 'map{split()[1]}.map(&:to_i).inject(0,:+)' 300
  10. Gr8 — grep $ ls img1.jpg img2.jpg img3.jpg img4.png img5.png

    img6.png $ ls | gr8 ‘grep(/(.*)\.png$/)’ img1.png img2.png img3.png