Skip to content

Instantly share code, notes, and snippets.

View dastinnette's full-sized avatar

David Stinnette dastinnette

View GitHub Profile
@dastinnette
dastinnette / pubsub.md
Last active April 19, 2016 15:17
make apps talk with magic (pigeons)
  1. How would you set up communication between two applications?
  • carrier pigeons
  1. How about n different applications?
  • n carrier pigeons
  1. What if the communication had to be in real time?
  • real fast pigeons in real time
@dastinnette
dastinnette / database_blog.md
Last active April 15, 2016 04:00
Improving Database Performance blog outline

###Improving Database Performance

  • Why DB performance can be an issue/is important
  • Introduce my personal project example, a dumpster fire of slow query sadness
  • Step one: Measure/analyze, never guess
  • Walk through solving Politweets pain point
  • Other problems & how to fix thru advanced AR queries
  • Profit
  • Dance

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?

  • She creates an array of invaders instead of creating each individually. I have 3 classes of fish but can create arrays of these 3 classes instead of creating each fish (20+) individually.

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

@dastinnette
dastinnette / require.markdown
Last active April 2, 2016 20:16 — 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?
  • A module is an object in Node that maps one file directly to another. One node must require another and the required node must export specific information to be exposed in other files.
@dastinnette
dastinnette / js_exercism_comparison.markdown
Last active March 26, 2016 23:42
Comparing my exercism submissions to other solutions

Leap

My Code

Other Solutions

  • Solution 1 - This person used an approach similar to my own but included an explicit if else statement. This makes the code more readable, but refactoring is possible.
  • Solution 2 - This person used a more variable oriented approach. It's interesting to see them store the modulo result to a variable and run that through an if/else statement. Refactoring possible, but fairly concise solution.
  • Solution 3 - This is a very concise solution, similar to my own, yet they have omitted parenthesis making this code slightly less readable. A good example of when refactoring is taken to an unnecessary extreme.
  • Solution 4 - This solution is concis
@dastinnette
dastinnette / jquery_fundamentals.md
Created March 21, 2016 13:23
jQuery fundamentals

What is something you learned that was particularly surprising/interesting?

  • Chaining seems very useful, I'll need some more practice there
  • Same story with manipulating the DOM, very powerful but more context and practice needed

What was something you already knew?

  • After completing other assignments and reading, much of the javascript basics section
  • Selectors
  • DOM traversal

Was there anything you feel you still don't understand?

####Interesting

  • The immediate flexibility with objects in js vs very regimented Ruby
  • Hoisting is cool. Sorry Ruby, I’m sure we can still be friends
  • Function declarations over function expressions all day erry day
  • Functions are objects(!!) Good lord Ruby, get it together.
  • Attribute flexibility is pretty dope

####Skim?

  • Honestly none. But don’t let that fool you, there’s plenty that still stumped me.
@dastinnette
dastinnette / metz_review.md
Created March 20, 2016 23:28
Sandi Metz' Rules For Developers

####Sandi Metz' Rules For Developers

Which of Sandi's rules do you feel like might be the hardest to follow? Why?

Rule 2 - "Methods can be no longer than five lines of code" - strikes me as being a little too inflexible. While this encourages good things like refactoring and use of private methods, sometimes I find that a longer method is essential. In my personal project I needed to pass a JSON object to the js file that fed my map and if I had broken this longer method into separate methods it would have called my database more times than was necessary and slowed the speed of the page load. I think with this rule in particular, there is a time and a place for it.