Skip to content

Instantly share code, notes, and snippets.

View rossedfort's full-sized avatar

Ross Edfort rossedfort

View GitHub Profile
@rossedfort
rossedfort / recursion.markdown
Last active February 26, 2016 21:50 — forked from rrgayhart/recursion.markdown
Recursion and Generators Homework
  • Watch Recursion
  • Fork this gist
  • Answer the following questions in your fork
    • Do you pronounce 'babel' in the same way?
      • No
      • Follow Up Question: Will you now?
        • Yes, bobble FTW
    • What is an example of why/where you might use recursion
  • An example of when I would use recursion is if I had a linked list or tree-like data structure that I needed to parse. Instead of looping through every element of the data-set, I could use recursion to format it.

Step One: Watch Mary Rose Cook Live Codes Space Invaders from Front-Trends. (The second worst conference name ever?)

Step Two: Fork this gist.

Step Three: Respond to this question in your fork: What is one approach you can take from this Mary's code and implement in your project?

  • One approach from Mary's implementation of space invaders that I could use in flappy bird was her use of the .filter() method for collision detection. It would be great for Flappy Bird because we are already instantiating our pipes as an array of nwe pipe objects. I think with some simple refactoring, we could improve upon our collision detection.

Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.

Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)

Step Two: Fork this gist.

Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).

  • Did any of the responsibilities that she lists surprise you?

    The part about application state surprised me a little bit, because it is not something I usually think about while writing client side code. It's not that I don't know it's a very important factor of client side code, it's just that I don't usually realize how it ties in to my application. For me, 'state' is an ambiguous concept that I don't fully understand.

  • Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?

@rossedfort
rossedfort / require.markdown
Last active February 16, 2016 22:12 — forked from rrgayhart/require.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?
**Step One**: Watch [Sorting Algorithms in JavaScript](https://www.youtube.com/watch?v=uRyqlhjXYQI)
**Step Two**: Fork this gist.
**Step Three**: Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"
The most important things to think about when chosing a sorting algorithm are space and time.. OOoooOOoooOoo. By space I mean memory to perform calculations. And by time, I mean how long the sorting algorithm will take. Bubble sort is slow, but takes up little memory, and Merge sort is super fast, but takes up large chunks of memory to perform it's recursive functions. Insertion sort is right in the middle, which makes it desirable in some occasions. However, like most times in programming, the answer of which sorting algorithm to use, is 'it depends'
**Step Four**: _Totally Optional_: take a look at some of the other forks and comment if the spirit moves you.

JavaScript Functions

I can explain the difference between function declarations and function expressions.

  • yes

I can explain what the value of this is in a normal function.

  • yes

Array Prototype Methods

I understand that functions in JavaScript can take any number of arguments.

  • yes

I can describe the similarity between blocks in Ruby and anonymous functions in JavaScript.

  • yes
@rossedfort
rossedfort / javascriptExercismComparisons.md
Last active February 7, 2016 17:55
Javascript Exercism Comparisons

Leap

my code

  • responder 1 - This person took a very similar approach that I did, except the logic was exactly the opposite. Instead of checking if the year was evenly divisible by 4, they checked if it wasn't.
  • responder 2 - Ryan's approach is very explicit in that it has different conditions for each case. To me, it reads easier event though it is slightly longer.
  • responder 3 - Amber's approach is extremely simplistic. She takes advantage of the fact that conditionals return a true or false value inherently, thus removing the need to explicitly return true or false.
  • responder 4 - This is another example of an easily readable solution even though it is slightly more verbo
@rossedfort
rossedfort / SVG's with Robbie and Ross.md
Last active January 25, 2016 21:28
An outline of a student led session on Scalable Vector Graphics

Intro - 10 mins

Image Formats

  • Raster(pixels) vs. Vector(paths)
  • Raster images use a series of pixels in a matrix like format
    • .png, .jpg, .tiff etc.
    • Hard to scale
    • compression = gross
  • Vector images use series of points and paths to construct images
    • Makes them easy to scale(math)

Recap

  • function setup()
  • function draw()
  • no 'var'
  • interactivity, mousePressed(), mouseX, mouseY, etc.

New Stuff

  • p5.sound library
  • Cool project
  • How can we interact with sound through the browser