Skip to content

Instantly share code, notes, and snippets.

View pindell-matt's full-sized avatar

Matt Pindell pindell-matt

View GitHub Profile

##Leap My code: here

  • Responder #1 (here) - This response went for the full if/else loop (similar to how I attacked this challenge the first time I did it in Ruby) - I think the one-line version is more concise, albeit a bit more difficult to understand at first glance.

  • Responder #2 (here) - This response was closer to mine, but still used explicit true / false returns, also - they establish the Year variable outside the isLeap function, which I don't think is ideal.

  • Responder #3 (here) - This response sets a leap variable to default to true, and only updates it as needed - interesting approach, not sure if it's good or bad - but I like the line of thinking.

  • Responder #4 ([here](http://exercism.io/submissions/86c0e1fe1fd74fa5b904529016c

Advenutres in Digging into a Lower-Level Language

After just a few months of knowing Ruby

Throughout my time at the Turing School of Software and Design, I've been continuously stoked about absorbing as much information as I can - languages, programming concepts, logic, etc.

And while it can be overwheliming at times, I've drawn specific inspiration from 2 sources:

  • The great Turing Tradition of diving headlong into the deep-end of the pool in any/everything.
  • This gist: How To Survey

The culture at Turing actively encourages you to do your best - to go beyond your comfort zone - and, they give you the tools to do so, which is unquestionably my favorite aspect of the program.

Using Rust from within Ruby using Foreign Function Interface (FFI)

Background

  • I've been experimenting with Rust in my free time.

Brief intro to Rust

  • Explain core values (safety, speed, concurrency) / what differentiates it from Ruby
  • Write "Hello, World" (keepin' it classic)
  • Q: What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?

  • A: To consolidate multiple files into one, by appending the contents of each - doing so puts them all in one easily-accesible place.

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

  • A: To compile into an intermediate form that is faster for a compiler to process. Allows coffeescript and sass to provide heaps of synactic sugar to make your life easier - they also provide errors at build time as opposed to run time.

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

  • A: To remove whitespace / unecessary characters from a program - withouth changing it's functionality. It reduces the amount of data that needs to be transferred (making things faster) without changing what's happening.

What are some rules of thumb for proper commit messages? Write a gist of rules you can share with your team.
* 1st line should be 50 characters or less, followed by a blank line, start with a capital letter,
and end without a period.
* The 1st line should also be written in the imperative mode, as if you were commanding someone.
Start the line with "Fix", "Add", "Change" instead of "Fixed", "Added", "Changed".
* Avoid `-m / --message` when using `git commit` - as it subtly encourages a shorter,
less-descriptive message, due to the constraints of the terminal.
* Answer the following questions:
* Why is this change necessary
## Models, Databases, Relationships in Rails
#### What is the difference between a primary key and a foreign key?
Primary Keys are uniq_ids for a table, foreign keys are primary keys featured on a separate table.
#### Where would we find a primary key?
On any table.
#### What would it be called by default?
Id.
@pindell-matt
pindell-matt / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:17 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD

  2. CRUD is an acronym to remember the basic functionality: 'Create', 'Read', 'Update', and 'Delete'

  3. 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.

  4. '/elements' + GET - for viewing all elements.

  5. '/elements/:id' + GET - for viewing a specific element.

  6. '/elements/new' + GET - for viewing a form to create a new element.

  7. '/elements' + POST - for submitting a form to create a new element, redirects to list of all elements.

  8. '/elements/:id/edit' + GET - for viewing a form to edit an already-existing element.

  9. '/elements/:id' + PUT (PATCH) - for submitting a form that edits an already-existing element.

Introduction to Sinatra

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

To provide different responses to different requests - taking the user to different pages / down different paths, to update or access different information, depending on the different requests (GET, POST, DELETE, etc.)

2. How do you pass variables into the views?

You can pass in instance variables (without explicitly passing them through the :locals hash) or local variables (in which case you must explicitly use the :locals hash ex: erb(:index, :locals => {:example => example})

3. How can we interpolate ruby into a view (html)?