Skip to content

Instantly share code, notes, and snippets.

https://gist.github.com/maxrice/d92042a88ab14fb80bf45b7a53b548ba#file-app-controllers-todo_list_controller-rb-L2

  • We can probably move this sort of functionality in the ApplicationController. We probably need to access the current user in other places besides this specific controller in the future.

https://gist.github.com/maxrice/d92042a88ab14fb80bf45b7a53b548ba#file-app-controllers-todo_list_controller-rb-L4

  • In the index controller action we are building up the query based off certain params being passed in. This query generation does not belong in the controller. We can use something like the interactor pattern to pull this logic out and generate our query for us, or the next best place would be in the model.

https://gist.github.com/maxrice/d92042a88ab14fb80bf45b7a53b548ba#file-app-views-todo_lists-list-erb-L7

  • I think a nice added feature to this do list is being able to do a bulk update on tasks that are completed. Since we are just using RoR here with no JavaScript we get a new page load everyt

Events

  • Events are let us have these really awesome user interactions on the page
  • Show them inception explained(Scroll down is an event)
  • When you interact with a webpage what would be some other events?

Selecting an element

  • You use the same CSS selector to target that element
  • var changeButton = document.querySelector('#change-me')
  • We assign the element we selected to a variable to use later

Code Along - Alerts in CodePen

  • Math the alerts
  • alert(2+2)

They try some maths

  • Have them do modulo to and explain what it is

Comparisons

  • Always returns the values true or false
  • Have them guess if it returns true or false?

What is CSS?

  • Is used for styling the webpage we just built
  • Zen Garden

Styling elements

  • Selector, property, value.

Try it adding color

What is HTML

  • The structure and semantics of our webpage
  • One of the oldest languages for the web
  • Stands for Hyper Text Markup Language
  • Two things, HTML has tags and text.

Codepen of a paragraph tag

  • Opening and closing tag
  • Everything between the opening and closing tag is part of this paragraph

What is front end engineering

  • The part of a website or application that a user interacts with. What they click, touch, see, etc.
  • FEE deals with the part of the code base that is responsible for handling
  • Static -> Rich interactive experiences
  • Show Code Pens
  • Deisgners and comps, don't have to be a design genius

What technologies are used on the front end

  • HTML - The structure and semantics of the web page
  • CSS - Make things looks amaaaazing

Big O Notation(40 - 55 minutes)

  • I had them discuss the pros and cons in small groups. I tried to give them context of what would a small startup do, vs a big corporation.
  • Rate these in order of importance. Tell me why they are important, and any possible pros and cons associated with implementing these items.(10 minutes)
  • Performance - Optimizing for performance may not matter(Don't preoptimize), could be important if you need a ton of server space and rely on a fast UX
    • Ticket master rant 8 second 4g load time for a interactive map
    • Performance is about $$$$$$$$
  • Testing
    • Sacreligious but may not be important for an MVP app. You start up is out of runway and you need features!
    • Obvious pros
  • Readable code(well refactored code)

Talking technical

  • I see that you got into development recenlty how did you get into it?

  • Why do you like using Ruby on Rails? What don't you like about using Ruby on Rails?

  • When would you use a class method vs. a instance method? Why?

Review of concepts(10 mins)

  • Privilege Escalation
  • Has to deal with authorization
  • I can do things that I'm not supposed to.
  • How would this apply to a multi-tenant ecommerce application?
  • Mass Assignment Vulnerabilities
    • Example in Rails?
    • A whitelist of attributes someone can assign to an object.
  • Examples
  • Generate a public/private key pair! gpg --generate-key

  • Export a public key gpg --output name_of_file.gpg --export email_of_user

  • Import a public key gpg --import name_of_file.gpg

  • Encrypt a file