Skip to content

Instantly share code, notes, and snippets.

View stevepentler's full-sized avatar

Steve Pentler stevepentler

View GitHub Profile

##One thing I learned looking at my partner's css/Bootstrap/styling was…

  • I rely too heavily on custom css styling ##One thing I suggested to my partner was…
  • Question order of cascading
  • Not to be frustrated because it's hard to use all the beneficial tools with such a simple app. ##The thing I liked best about my partner's css/Bootstrap/styling was…
  • He stuck to bootstrap classes
@stevepentler
stevepentler / cfu_crud_in_sinatra.markdown
Created December 1, 2015 20:03 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD.
  2. There are seven verb + path combinations that are necessary in a basic Sinatra app in order to provide full CRUD functionality. List each of the seven combinations, and explain what each is for.
  3. Why do we use set method_override: true?
  4. Explain the difference between value and name in this line: <input type='text' name='task[title]' value="<%= @task.title %>"/>.
  5. What are params? Where do they come from?
@stevepentler
stevepentler / Agile.md
Last active December 7, 2015 17:30
Agile Manifesto
  1. Increases adaptability and collaboration. Also, projects flow more naturally with fewer instances of specialized teams waiting for projects.
  2. It is demoralizing for teams to invest into a project, and then have a new requirement invalidate previous work. Shorter intervals and check-ins with customers means less rabbit holes and extraneous work.
  3. No. If a client does not want invest time communicating with the development team.
  1. Describe the request *response cycle. Start with the client making a request.
  • oh geez! Client sends request, makes it through rack and middleware, heads to DNS? DNS bounces the message to a few more servers with greater specificity each time. Eventually it locates the server and passes the response back through the rake/middleware to the client.
  1. Explain when each of these HTTP verbs would be used: GET, POST, PUT, DELETE.
  • GET is used to retrieve and display information from the server.
  • POST is used to modify the server by adding information.
  • PUT modifies information that exists in the server with greater specificity than POST.
  • DELETE LOLZ, duh
  1. What are all of the necessary routes for full CRUD functionality in Sinatra app? Why do we need seven routes when there are only four CRUD actions?
  1. What is the purpose of the router in a Rails project?

    • A router redirects the incoming HTTP request to the appropriate controller. It determines what type of information will be displayed and in what context we want to view the information (ex: to view / edit).
  2. What routes would be provided to you with the line resources :items?

    • Resources establishes the seven RESTful routes for the controller.
      • get "/items" => "items#index" INDEX
      • get "/items/:id" => "items#show" SHOW
      • get "/items/new" => "items#new" NEW
      • post "/items" => "items#create" CREATE # usually a submitted form
  • get "/items/:id/edit" => "items#edit" EDIT
  • git stash -- Things are bad, real bad, and now you want to switch branches, BUT you don’t want to commit what you’ve been working on yet; so you’ll stash the changes. -- To push a new stash onto your stack, run git stash

  • git stash list -- To see which stashes you’ve stored, you can use git stash list

  • git stash apply -- In this case, two stashes were done previously, so you have access to three different stashed works. You can reapply the one you just stashed by using the command shown in the help output of the original stash command: git stash apply. If you want to apply one of the older stashes, you can specify it by naming it, like this: git stash apply stash@{2}

Setting Group Expectations

Group Member Names:

  1. When are group members available to work together? What hours can each group member work individually? Are there any personal time commitments that need to be discussed?
  • JP lightning talk Friday
  • Aaron prep computability theory
  1. How will group members communicate? How often will communication happen, and how will open lines of communication be maintained?
  • Slack group (private)

What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

  • To put them together so theyre treated as one. We might want to concatenate to send fewer files for the same amount of data.

What does it mean to precompile files? What does this have to do with coffeescript and sass files?

  • To grab database info all at once for faster successive calls. Coffeescript and Sass files are precompiled so that all of their libraries can be accessed.

What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?

class Seed
def self.start
seed = Seed.new
seed.generate_users
seed.generate_items
seed.generate_orders
end
def generate_users
5.times do |i|
#unscoped
Class Item < ActiveRecord::Base
default_scope { where(status: "active") }
Item.all - returns only items with an active status
Item.unscoped.all - returns all items, regardless of whether they pass the validation
#Find using primary key
#can take an array as an arg to return client.id=1 and client.id=10
client = Client.find([1, 10])