Ethan Lee
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    <style type="text/css"> @import url("https://use.typekit.net/kwj4ujf.css"); body { background-color: #FF3700; } .reveal h1 { font-size: 3em; } .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { font-family: Gibson, BlinkMacSystemFont, sans-serif; font-weight: 700; color: white; } .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { font-weight: 600; } .reveal h3 { /*color: rgba(255, 255, 255, 0.7);*/ } .reveal > *, .reveal *, .reveal > * > * { color: white; font-family: Gibson, BlinkMacSystemFont, sans-serif; } .logo { position: absolute; right: 50px; bottom: 50px; width: 75px; z-index: 9999; } .reveal .controls { left: 120px; right: auto; } .reveal .slide-background.stack .slide-background:not(:nth-child(1)) { background-color: white; text-align: left; } .reveal .slides > section.stack > section:not(:first-child) { /*margin-left: -10%; margin-top: -10%;*/ text-align: left; } .reveal .slides > section.stack > section:not(:first-child) * { color: black; font-family: Gibson, BlinkMacSystemFont, sans-serif; } .reveal .slides > section.stack > section:not(:first-child) h1 { font-size: 48pt; color: white; background-color: #FF3700; padding: 5px 20px; display: inline-block; } .reveal code, .reveal pre { font-family: "Source Code Pro", monospace; } </style> # Week 1: Introduction to Ruby & The Web --- # Ruby on Rails Decal ## Lecture 1: Intro to Ruby and the Web --- # Agenda - Course Logistics - Lab Groups - Intro to Web Development - Environment Setup - Learning Ruby - What is Rails? - (Optional) Intro to Git ---- # Instructors <div style="display: flex; align-items: center;"> <img src="https://cl.ly/8c6f002a29b8/Image%202018-09-13%20at%2010.02.53%20AM.png" width="100" height="100" style="border-radius: 100%; margin: 20px;"> <h2>Aivant Goyal</h2> </div> <div style="display: flex; align-items: center;"> <img src="https://cl.ly/4400a9404f0f/Image%202018-09-13%20at%2010.01.03%20AM.png" width="100" height="100" style="border-radius: 100%; margin: 20px;"> <h2>Ethan Lee</h2> </div> ---- # Teaching Assistants <div style="display: flex; flex-wrap: wrap"> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/a31a52706613/Image%202018-09-13%20at%2010.08.00%20AM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Arpan Pal</h4> </div> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/a31a52706613/Image%202018-09-13%20at%2010.08.00%20AM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Pooja Nagpal</h4> </div> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/893fa9105797/Image%202018-09-13%20at%201.28.12%20PM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Melody Wei</h4> </div> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/ffa15231f3a2/Image%202018-09-13%20at%201.27.39%20PM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Adhiv Dhar</h4> </div> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/0bb162047bb4/Image%202018-09-13%20at%201.29.03%20PM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Tommy Poa</h4> </div> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/c3839394e67d/Image%202018-09-13%20at%201.29.58%20PM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Jessica Hsiao <sup style="font-size: 12pt">*OH only</sup></h4> </div> <div style="display: flex; align-items: center; margin-right: 35px;"> <img src="https://cl.ly/a31a52706613/Image%202018-09-13%20at%2010.08.00%20AM.png" width="75" height="75" style="border-radius: 100%; margin: 20px;"> <h4>Joshua Yang <sup style="font-size: 12pt">*OH only</sup></h4> </div> </div> --- # Course Logistics - Weekly Lecture: Kroeber 160 Thurs 5-7 - If you need to leave early, please do so quietly. It's your responsiblity to look up slides and catch up on material! - 11 Classes Total (No class on 11/22 for Thanksgiving!) - Weekly Attendance (20% of grade) - 0-1 unexcused = 20/20 - 2 unexcused = 10/20 - 3 unexcused = 0/20 - 4+ unexcused = Automatic NP :( - Soft Pre-req: CS 61A (Highly Recommended!) - Let us know if you have any concerns and we'll do our best to support you - Optional Corresponding Textbook: http://guides.rubyonrails.org/index.html --- # Course Resources - Course Website: railsdecal.herokuapp.com - Will have lecture slides, homework, and other resources - Attendance taken through here - Syllabus: https://goo.gl/oVz9Ux (Needs updating to Fall 2018) - Slack! Check email for invite - Lab Group Channels - Public Question Channels - Contact staff by messaging us privately - Staff Weekly Office Hours: TBA! (Needs updating) --- # Grading - 4 Homeworks, 2 Projects - Four slip days for any type of assignment - at most 2 allowed for final project - Grade Breakdown - 20% Attendance - 25% Homework - 25% Project 1 (Individual) - 30% Final Project (Group) [no submission = automatic NP] - 2 Units P/NP - 70% or higher is passing --- # In-Class Labs + Discussions - Two hours of lecture is boring - Interspersed Discussion Questions and Mini-Labs - Starting next week we'll be grouping each of you with a TA - They will be your go to person + group for in-class and out-of-class questions and support! --- <!-- .two_col --> # Let's Talk About The Web! - *Discussion Question* What happens when you type http://www.facebook.com in your browser and press `enter`? - Understanding the language of the web: Text! - We communicate with websites and web applications through requests (structured text) - A simpler static site will return text in the form of html - Our browser reads the html and makes it look pretty for us - The issue of templating - When any of us go to facebook.com, we see different text come back to us. - Structure of Web applications - Web applications have a data store and building a web application involves coordinating between what the user is asking for, what data is involved, and how to show the relevant "text" for the browser to display ![](https://i.imgur.com/svdkDFG.png) --- # Communicating with Web Applications - Requests! - Requests have 3 main components - Type (e.g.: GET, PUSH, PUT) - Headers (Dictionary of key-value pairs) - Body (Plain-text) - Let's see how this looks! (Telnet Demo) - Browser is simply sending requests to websites asking for the text to display to the user - We can also send requests and get back text! --- # Try it yourself now! - In-Class Mini-Lab - Use telnet or a similar terminal application to send a GET request to railsdecal.com --- # What is Ruby? - In-Class Demo! <div id="container"> <div id="shell"> <div id="output"> </div> <div id="command"> <span class="prompt">&gt;&gt;</span> <div id="editor"></div> </div> </div> </div> --- - High level programming language - Dynamically Typed (like Python!) - Object-Oriented (like Java!) - Focus on humans, not machines - Everything is an object - `{ 1 => Integer, ‘String’ => String, :symbol => Symbol, [] => Array, {} => Hash, nil => NilClass }` - Learn more: https://www.codecademy.com/articles/glossary-ruby --- # Common Ruby Objects - `nil` : representation of nothingness; similar to null, undefined - `“String”` : Mutable sequence of characters - `:symbol` : Strings, sort of (see next slide) - `1` : Integer - `true && false` : Boolean - `[]` : Array - Can contain multiple types of objects ( example: `[ 1.0, “foo”, :baz ]` ) - `{}` : Hash or Dictionary - `{:foo => "bar", baz: :buzz} # two syntax styles`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully