SlideShare a Scribd company logo
1 of 16
Download to read offline
Learning to Code for
Startup MVP


Presented by Henry Shi
Agenda – 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 – 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 – 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

What's hot

Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterSteven Chau
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016Sunny Sharma
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]Huy Do
 
PharoDAYS 2015: On Relational Databases by Guille Polito
PharoDAYS 2015: On Relational Databases by Guille PolitoPharoDAYS 2015: On Relational Databases by Guille Polito
PharoDAYS 2015: On Relational Databases by Guille PolitoPharo
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionOrtus Solutions, Corp
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivationjistr
 
Functional Programming in PHP
Functional Programming in PHPFunctional Programming in PHP
Functional Programming in PHPAurimas Niekis
 
Erlang: TL;DR
Erlang: TL;DRErlang: TL;DR
Erlang: TL;DRvorn
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJSTim Sommer
 
Playing with playgrounds
Playing with playgroundsPlaying with playgrounds
Playing with playgroundsEurico Doirado
 
A brief intro to RubyMotion
A brief intro to RubyMotionA brief intro to RubyMotion
A brief intro to RubyMotionKamil Lelonek
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and AbstractionsMetosin Oy
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend toolingpksjce
 

What's hot (20)

Ruby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles NutterRuby Midwest 2010 jRuby by Charles Nutter
Ruby Midwest 2010 jRuby by Charles Nutter
 
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016Microsoft Azure DocumentDB -  Global Azure Bootcamp 2016
Microsoft Azure DocumentDB - Global Azure Bootcamp 2016
 
Why ruby and rails
Why ruby and railsWhy ruby and rails
Why ruby and rails
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
 
[Start] Playing
[Start] Playing[Start] Playing
[Start] Playing
 
Crystal
CrystalCrystal
Crystal
 
PharoDAYS 2015: On Relational Databases by Guille Polito
PharoDAYS 2015: On Relational Databases by Guille PolitoPharoDAYS 2015: On Relational Databases by Guille Polito
PharoDAYS 2015: On Relational Databases by Guille Polito
 
Enterprise messaging
Enterprise messagingEnterprise messaging
Enterprise messaging
 
CBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusionCBDW2014 - Down the RabbitMQ hole with ColdFusion
CBDW2014 - Down the RabbitMQ hole with ColdFusion
 
Scala vs ruby
Scala vs rubyScala vs ruby
Scala vs ruby
 
Ruby and Rails short motivation
Ruby and Rails short motivationRuby and Rails short motivation
Ruby and Rails short motivation
 
Functional Programming in PHP
Functional Programming in PHPFunctional Programming in PHP
Functional Programming in PHP
 
Erlang: TL;DR
Erlang: TL;DRErlang: TL;DR
Erlang: TL;DR
 
MVC Gems
MVC GemsMVC Gems
MVC Gems
 
T4T Training day - NodeJS
T4T Training day - NodeJST4T Training day - NodeJS
T4T Training day - NodeJS
 
Playing with playgrounds
Playing with playgroundsPlaying with playgrounds
Playing with playgrounds
 
A brief intro to RubyMotion
A brief intro to RubyMotionA brief intro to RubyMotion
A brief intro to RubyMotion
 
.Net Fundamentals
.Net Fundamentals.Net Fundamentals
.Net Fundamentals
 
Performance and Abstractions
Performance and AbstractionsPerformance and Abstractions
Performance and Abstractions
 
Next generation frontend tooling
Next generation frontend toolingNext generation frontend tooling
Next generation frontend tooling
 

Similar to Code for Startup MVP (Ruby on Rails) Session 1

Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLBarry Jones
 
The story of language development
The story of language developmentThe story of language development
The story of language developmentHiroshi SHIBATA
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talkReuven Lerner
 
Ruby And Ruby On Rails
Ruby And Ruby On RailsRuby And Ruby On Rails
Ruby And Ruby On RailsAkNirojan
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Rormyuser
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84Mahmoud Samir Fayed
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming LanguageAdler Hsieh
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
Week 5
Week 5Week 5
Week 5A VD
 
Week 5
Week 5Week 5
Week 5A VD
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystemGeison Goes
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation platico_dev
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Railselliando dias
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formattersVisuality
 

Similar to Code for Startup MVP (Ruby on Rails) Session 1 (20)

Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
 
The story of language development
The story of language developmentThe story of language development
The story of language development
 
Rails development environment talk
Rails development environment talkRails development environment talk
Rails development environment talk
 
Ruby And Ruby On Rails
Ruby And Ruby On RailsRuby And Ruby On Rails
Ruby And Ruby On Rails
 
Why ruby
Why rubyWhy ruby
Why ruby
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
sl slides-unit-1.pptx
sl slides-unit-1.pptxsl slides-unit-1.pptx
sl slides-unit-1.pptx
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
 
Intro to Crystal Programming Language
Intro to Crystal Programming LanguageIntro to Crystal Programming Language
Intro to Crystal Programming Language
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
Week 5
Week 5Week 5
Week 5
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
Week 5
Week 5Week 5
Week 5
 
An introduction to the ruby ecosystem
An introduction to the ruby ecosystemAn introduction to the ruby ecosystem
An introduction to the ruby ecosystem
 
Ruby Presentation
Ruby Presentation Ruby Presentation
Ruby Presentation
 
Ruby in mule
Ruby in muleRuby in mule
Ruby in mule
 
RubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on RailsRubyStack: the easiest way to deploy Ruby on Rails
RubyStack: the easiest way to deploy Ruby on Rails
 
Ruby
RubyRuby
Ruby
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
 

Code for Startup MVP (Ruby on Rails) Session 1

  • 1. Learning to Code for Startup MVP Presented by Henry Shi
  • 2. Agenda – 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 – 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 – 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