Skip to content

Instantly share code, notes, and snippets.

Jonathan/Thomas Pickett Black Thursday DTR

JB:

  • Prefers to leave for dinner around 7:30
  • Prefers to work after school after a short break
  • Prefers to work together at all times(pairings)
  • Likes to swap driving of code.
  • Strengths :Problem solving, Testing
  • Weaknesses : Ruby Syntax

Introduction to Sinatra

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

To act accordingingly to whatever is sent to the server.

2. How do you pass variables into the views?

through instance vairables or locals

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

@Jbern16
Jbern16 / cfu_crud_in_sinatra.markdown
Last active March 23, 2016 04:10 — forked from rwarbelow/cfu_crud_in_sinatra.markdown
CRUD in Sinatra -- Check for Understanding
  1. Define CRUD. create, read, update, delete

  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. read: get, read: get, create: get, create: post, update: get, update: put, delete:, delete

  3. Why do we use set method_override: true? to set the form to put or delete instead of the default value of post. We override the verb.

  4. Explain the difference between value and name in this line: ``.

## Models, Databases, Relationships in Rails
#### What is the difference between a primary key and a foreign key? Where would we find a primary key? What would it be called by default? Where would we find a foreign key? What is the naming convention for a foreign key?
We find a primary key as the main identifier of a table. Example: Teachers: TeacherId. A Foreign creates the relationship between tables.
Example: Teachers : course_id. The naming convention for these are the table they belong to + "_id"
#### Write down one example of:
* a `one-to-one `relationship.
each person has one toothbrush and one toothbrush has one person. This is modeled by combining both to a single table because they are
dependent of eachother
#### Important links:
The Elm Architecture - https://github.com/evancz/elm-architecture-tutorial/
StartApp.Simple - https://github.com/evancz/start-app
Core Libraries - http://package.elm-lang.org/packages/elm-lang/core/3.0.0/
#### Install
Install the Elm Platform by downloading and running the Elm installer for your favorite operating system.
Once you've installed the Elm Platform, you should be able to run the following command:
@Jbern16
Jbern16 / ElmElective.md
Last active April 14, 2016 15:40
Having Fun with Elm Lang

Intro to Elm and the Elm Architecture ~ 20 min

What is elm? What is it used for? Why Elm?

    - Functional - What does that mean? 
    - What is a reactive web-app? 
    - Briefly talk about how it compiles -> JS
    - Simple but deep functionality. 
    - Error Messages are awesome!

Elm Docs

  • How Elm Packages Work
@Jbern16
Jbern16 / hub_cuts.md
Created April 14, 2016 15:27
Github Shorcuts

SOURCE CODE

t -> File Finder l -> code finder w -> switch to new branch or tag

Pull Requests

g + p -> go to your prs c -> create an issue u -> filter by author o + enter -> Open an issue

What does it mean to concatenate files? Find an image of an example concatenated file. Why would we want to concatenate files?
Combine files. This will increaase performance and provide an efficient package that our browser can interpret
What does it mean to precompile files? What does this have to do with coffeescript and sass files?
Sass -> CSS, CS -> JS. Our browser needs CSS/JS/HTML. Sass and CS abstractions of their base language/
What does it mean to minify files? Find an image of an example minified file. Why would we want to minify files?
Strip whitespace and uneeded data. This will increaase performance and provide an efficient package that our browser can interpret
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?
### Leap
##Leap
My code: [here](https://github.com/Jbern16/exercism/blob/master/javascript/leap/leap.js)
* Responder #1 ([here](http://exercism.io/submissions/9b50b27c92fb45a2848639bbce4d95ae) - This user used a super a clean conditional statement and logic to solve this problem. He broke out what a leap is instead of nesting a conditional and and responding with a boolean directly. I think this approach was very good.
* Responder #2 ([here](http://exercism.io/submissions/5f87d2e1f50242c08904e065dea8dad5) - This user used a similar broken down condiional as I did, however with more conditions. Although morereadable it creates a longer conditional which I am not a fan of doing.
* Responder #3 ([here](http://exercism.io/submissions/aa2c5470f91441ac9c5af928ec58092d) - This user used one very long, one line conditonal. Although short, It is not readable and a little too clever. By breaking it down multiple lines its easier to reason about.

MVP:

Player must survive unlimited waves of enemies.

You can move(WASD) and shoot in 360 degree radius(Mouse)

Zombies move toward you

Zombies spawn in random places