Skip to content

Instantly share code, notes, and snippets.

View saylerb's full-sized avatar

Brian Sayler saylerb

  • Denver, CO
View GitHub Profile
@saylerb
saylerb / prework.md
Last active March 21, 2016 05:29 — forked from mbburch/prework.md
An example template for your Turing pre-work Gist

Turing School Prework

Task A- Practice Typing:

  • screenshots of scores will be posted in comments

Task B- Algorithmic Thinking & Logic:

  • screenshots of completed sections will be posted in comments

Task C- Create your Gist:

Introduction to Sinatra

1. What is the purpose of the server file (routing)?

  • The server file contains the routes for specific HTTP verbs, and determines what the client gets back with each request

2. How do you pass variables into the views?

  • Two ways
  • Using an instance variable:
@saylerb
saylerb / crud.md
Last active May 10, 2016 16:53 — forked from Carmer/crud.markdown
  1. Define CRUD.
  • Create, Read, Update, Delete. Gives us all the behavior to make a fully-functional web application
  1. 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.
  2. GET "/tasks" - displays all the current tasks with the :index view
  3. GET "/tasks/:id" - display a single task with the :show view
  4. GET "/tasks/new" - display the form to create a new task with the :new view
  5. POST "/tasks" - write a task to the database, and redirect back to "/tasks"
  6. GET "/tasks/:id/edit" - display the form for editing an existing task with the :edit view
  7. PUT/PATCH "tasks/:id" - update a specific task in the database with new data, and display the edited task by redirecting back to "/tasks/:id"

How does the Agile model compare to the Waterfall model?

  • The Agile model is an iterative process, while the Waterfall is a sequential process
  • A Waterfall model assumes we have full information at the beginning of a project, and that the project's characteristics won't change.
  • The Agile method assumes that the unexpected will happen, that new information will be learned as the project progresses, and that the project will change over time.

Why do you think Agile is so popular in software development?

  • What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?
    • concatenate - append files together, Merge multiple files into a single file. Easier for a machine to deal with loading a single file, rather than mulitple
  • What does it mean to precompile files? What does this have to do with coffeescript and sass files?
    • Precompile -> turn higher-level languages into their base languages (coffeescript -> javascript, sass -> css)
  • What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?
    • Minifying files helps make the files more lightweight by removing whitespace. Making it not human readable probably helps with performance.
  • Start up the server for Catch 'em All (rails s) and navigate to http://localhost:3000/assets/application.js. Then open up the code for application.js in your text editor. Why are these not the same?
  • What is a manifest (in terms of the asset pipeline)? Wher
@saylerb
saylerb / rspec_model_testing_template.rb
Created June 8, 2016 15:50 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:

Intermediate SQL Homework

Summary Questions

  1. What is an INNER JOIN?
An inner join will combine the records that exist two tables

XML - pain to write and parse, but human and machine readable JSON - faster, human and machine readable, maps well to data structures in other langauges Writing JSON - double quotes, wrap it in single ruby JSON & RUBY - JSON.parse(json_string) JSON.generate(some_hash) some_hash.to_json JSON & jQuery = AJAX stuff:

/tweets.json is an endpoint for your application.

Rush Hour the Hard Way

Payload Requests Business Logic

  1. Write the ActiveRecord and SQL queries for average response time for all payload requests.

    PayloadRequest.average(:responded_in)

Main features

  • Asset concatenation

    • append files together, Merge multiple files into a single file.
    • Easier for a machine to deal with loading a single file, rather than mulitple
    • Reduce the number of requests that a browser makes to render a web page.
    • Sprockets concatenates all JavaScript files into one master .js file and all CSS files into one master .css file.
  • Asset minification

    • Minifying files helps make the files more lightweight by removing whitespace.