ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Learning to Code for
Startup MVP


Presented by Henry Shi
Agenda ¨C Wednesday November 7

1. Review of Last Session

2. Ruby Basics
  o Syntax and semantics
  o Practice makes perfect

1. Rails Models (but no Bottles)
  o   ORM and SQL introduction
  o   Migrations
  o   Making the User model
  o   Signup/Signin/Signout
Prework ¨C Setup
? Windows (not recommended if possible):
  o http://railsinstaller.org/
  o Use Sublime Text for your text editor
? OSX:
  o http://railsinstaller.org/
  o This includes osx-gcc-installer (200mb)
? Linux:
  o http://blog.sudobits.com/2012/05/02/how-to-install-
    ruby-on-rails-in-ubuntu-12-04-lts/
Prework - Git
Install git if not already included:
http://www.git-scm.com/book/en/Getting-
  Started-Installing-Git

Configure Git:
git config --global user.name "Your Name¡°
git config --global user.email
  your.email@example.com
Review of Last Session

1. The Web and How it Works

2. Git/Github

3. Rails and Ruby

4. Heroku
The Web - Overview
GIT/GITHUB
? What is GIT?
? Distributed Version Control System (DVCS)
? Why should I care?
  o Never lose data or accidentally overwrite, delete files
  o Collaborate with peers anywhere and stay in sync
    automatically (no more _v1, _v2, _final, _final_final¡­)
  o Compare and track changes over time, and easily
    revert changes
  o Deploy code to real web
Rails
? Ruby on Rails is an open-source web
  framework that¡¯s optimized for programmer
  happiness and sustainable productivity.

? It lets you write beautiful code by favoring
  convention over configuration.

? 80/20 Rule =>great for Startup MVP
Heroku
What is Heroku?
?a hosted platform built specifically for
 deploying Rails and other web applications in
 1 command
?Best thing since sliced bread
Ruby ¨C Programmer¡¯s Best Friend
? Ruby is a dynamic, open source
    programming language with a focus on
    simplicity and productivity. It has an
    elegant syntax that is natural to read and
    easy to write.

? We will only cover the necessary syntax
    needed to create a rails app
?   Thankfully, its not a lot ?
Interactive Ruby Shell
? For the following slides, you should follow
  along with the Interactive Ruby Shell (irb)

? Open a terminal, type irb and press enter
Ruby - Strings
? Characters (letters, digits, punctuation)
  surrounded by quotes
food = "chunky bacon"
puts "I'm hungry for, #{food}!"
>> "I'm hungry for, chunky bacon!"




? Can perform operations on strings,
  concatenation, length, empty, etc
 ¡°Hello¡± + ¡°World¡±
 >> ¡°Hello World"
 ¡°Henry¡±.empty?
 >> false
Ruby - Numbers
? Self Explanatory
123.class     (123.0).class
>> Fixnum     >> Float




? Can add different types of numbers directly
Ruby - Symbols
? Characters (letters, digits, punctuation)
   preceded by colon (:)
food = :hello
:asf3fasdf.class
>> Symbol




? Lightweight strings
? immutable
Ruby - Array
? List surrounded by square brace and
  separated by commas, zero indexed
a = [1, 2, 3]
b = ('a'..'e').to_a        # ["a", "b", "c", "d", "e"]
c = %w[foo bar baz quux]   # ["foo", "bar", "baz", "quux"]




? Can perform operations on arrays, add,
  remove, reverse etc
ERROR: undefined
OFFENDING COMMAND: f¡®~
STACK:

More Related Content

Code for Startup MVP (Ruby on Rails) Session 1

  • 1. Learning to Code for Startup MVP Presented by Henry Shi
  • 2. Agenda ¨C Wednesday November 7 1. Review of Last Session 2. Ruby Basics o Syntax and semantics o Practice makes perfect 1. Rails Models (but no Bottles) o ORM and SQL introduction o Migrations o Making the User model o Signup/Signin/Signout
  • 3. Prework ¨C Setup ? Windows (not recommended if possible): o http://railsinstaller.org/ o Use Sublime Text for your text editor ? OSX: o http://railsinstaller.org/ o This includes osx-gcc-installer (200mb) ? Linux: o http://blog.sudobits.com/2012/05/02/how-to-install- ruby-on-rails-in-ubuntu-12-04-lts/
  • 4. Prework - Git Install git if not already included: http://www.git-scm.com/book/en/Getting- Started-Installing-Git Configure Git: git config --global user.name "Your Name¡° git config --global user.email your.email@example.com
  • 5. Review of Last Session 1. The Web and How it Works 2. Git/Github 3. Rails and Ruby 4. Heroku
  • 6. The Web - Overview
  • 7. GIT/GITHUB ? What is GIT? ? Distributed Version Control System (DVCS) ? Why should I care? o Never lose data or accidentally overwrite, delete files o Collaborate with peers anywhere and stay in sync automatically (no more _v1, _v2, _final, _final_final¡­) o Compare and track changes over time, and easily revert changes o Deploy code to real web
  • 8. Rails ? Ruby on Rails is an open-source web framework that¡¯s optimized for programmer happiness and sustainable productivity. ? It lets you write beautiful code by favoring convention over configuration. ? 80/20 Rule =>great for Startup MVP
  • 9. Heroku What is Heroku? ?a hosted platform built specifically for deploying Rails and other web applications in 1 command ?Best thing since sliced bread
  • 10. Ruby ¨C Programmer¡¯s Best Friend ? Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. ? We will only cover the necessary syntax needed to create a rails app ? Thankfully, its not a lot ?
  • 11. Interactive Ruby Shell ? For the following slides, you should follow along with the Interactive Ruby Shell (irb) ? Open a terminal, type irb and press enter
  • 12. Ruby - Strings ? Characters (letters, digits, punctuation) surrounded by quotes food = "chunky bacon" puts "I'm hungry for, #{food}!" >> "I'm hungry for, chunky bacon!" ? Can perform operations on strings, concatenation, length, empty, etc ¡°Hello¡± + ¡°World¡± >> ¡°Hello World" ¡°Henry¡±.empty? >> false
  • 13. Ruby - Numbers ? Self Explanatory 123.class (123.0).class >> Fixnum >> Float ? Can add different types of numbers directly
  • 14. Ruby - Symbols ? Characters (letters, digits, punctuation) preceded by colon (:) food = :hello :asf3fasdf.class >> Symbol ? Lightweight strings ? immutable
  • 15. Ruby - Array ? List surrounded by square brace and separated by commas, zero indexed a = [1, 2, 3] b = ('a'..'e').to_a # ["a", "b", "c", "d", "e"] c = %w[foo bar baz quux] # ["foo", "bar", "baz", "quux"] ? Can perform operations on arrays, add, remove, reverse etc