Skip to content

Instantly share code, notes, and snippets.

View s-espinosa's full-sized avatar

Sal Espinosa s-espinosa

View GitHub Profile
@s-espinosa
s-espinosa / require-1602.markdown
Last active July 8, 2016 07:11 — forked from rrgayhart/require-1602.markdown
The Concept of Require

When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.

Read Node.js, Require and Exports and Organize Your Code with RequireJS

Fork this gist and answer the following questions:

  • In the context of Node, what is a module? In node a module is any file that includes a 'module.exports' statement allowing that code to be required in other files.
  • The code examples from the second blog post look very different from the first. Why? The second blog post is using RequireJS to achieve basically the same effect with different syntax. It seems as though RequireJS only allows access to the imported functions when wrapped in a require function.

Your Turn

Your mission now is to spend time in your projects doing some refactoring or researching and adding more code smells examples to this tutorial.

Fork this gist and include a link to your PR

Sal Espinosa PR on Matt Pindell's IdeaBox

Next Steps

Commits and the People Who Love Them

Background

  • Working on a React app with existing code
  • Screenshot
  • Description
  • Invitation to mentors and back-end team to comment

Our First Commit

Getting Up to Speed With a React Project

Background

  • Coming to a React app with existing code (documented in other post)

Files and What they Tell You

  • File Structure of Our Project

WebSockets Workshop (30 points)

Websockets Workshop

Link to Repo

Completed base functionality with the code along and was able to implement feature to show users the current vote tally. Would like to come back to the remaining 'your turn' questions, but wanted to submit current status before the deadline.

@s-espinosa
s-espinosa / 1602-mock-assessment-submission.markdown
Last active August 3, 2016 17:26 — forked from rrgayhart/1602-mock-assessment-submission.markdown
1602-mock-assessment-submission.markdown

Submission


Deadline

  • Deadline for the last commit on Master is 5:15 (README commits are fine after deadline).
    • If you have job/family related interruptions, note when and for how long in your submission gist and tag that time on to your deadline time as an extension, if needed.
    • You may continue to work on another branch after the deadline but it will not be considered in the eval

#Problem Solving

When you don’t know where to start

Write a test!

  • Writing a test will often help drive your decision making. If you later realize that some other piece of the application needs to be implemented first, it’s o.k. to skip the test (put an x in front of the it in RSpec, or write skip in the first line of an it block.
  • If you’re having trouble deciding which test to write, ask yourself if there are any relationships where one thing depends on the existence of another?
    • If so, do the thing that needs to be done first.
  • If not, just pick one! Maintain a bias towards action. Often in the process of working on one aspect of an application you will create a tool that makes some other easier. Alternatively, you will work on one part of an application and realize it’s more dependent on other functionality than you initially realized. This doesn’t mean that your time has been wasted. Even if you need to reassess the code that you’ve written up to this point, it’s lik

Learning to Use New Tools

General Google Tips

  • Be sure to include search terms for the specific context in which you’re using the tool:
    • ‘RSpec Rails’ will return results that give you a gem specifically to use in Rails apps
    • 'Capybara RSpec Rails’, or ’select second div Capybara' will return more relevant results than ‘Capybara'

First Time Setup

  • If you’re looking to set a tool up in your application, check docs to see if they have some description.
  • Within the docs, check to see if there’s a section specifically geared towards setting it up in your environment.

If we had infinite resources, we wouldn't bother stubbing methods out. Stubbing adds a layer of complexity to our tests.

However, our machines have limited computing power. Tests that touch multiple objects (even in the background), or read and write files, or perform complex calcuations take longer to run than tests that touch a single object/method.

When tests take too long to run, developers stop running tests.

Tests are no good to us if we don't run them.

We have to make tests run quickly for them to maintain their value.

From the Command Line

Action Command
Start a New Project mix phx.new project_name
Create DB mix ecto.create
Start App mix phx.server
Run App in Interactive Elixir (IEx) iex -S mix phx.server
Show Routes mix phx.routes