Skip to content

Instantly share code, notes, and snippets.

View jasonpilz's full-sized avatar
💻

Jason Pilz jasonpilz

💻
View GitHub Profile
@jasonpilz
jasonpilz / readmelove.md
Created February 20, 2016 20:39 — forked from rrgayhart/readmelove.md
README Love

##PROTIP: README Love

READMEs are AWESOME. They are one of the best things you can add to a repo, (other than quality code), to make it look professional.

####Things that make a README great:

  • A link to the production site on heroku
  • A screenshot (or a few) of what the app does (This is especially important if you don't have the production app up and running yet)
  • Directions on how to clone or fork the repo and run it locally (explain it like you're explaining things to a totally new programmer)
@jasonpilz
jasonpilz / recursion.markdown
Last active February 26, 2016 21:45 — forked from rrgayhart/recursion.markdown
Recursion and Generators Homework
  • Watch Recursion

  • Answer the following questions in your fork

    Do you pronounce 'babel' in the same way?

    • Noooeee

    Follow Up Question: Will you now?

    • I sure hope so because that guy is a legend.

What is an example of why/where you might use recursion

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

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?

  • I was surprised by seeing the 'application state' category. This is not something I considered when thinking about components to test.

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

  • I would say I had clear intention of testing the 'data/server communication' category, as well as set up. I feel like the 'presentation & interaction' category would be how I would think of integration tests (I felt this video was referring only to unit tests). The 'application state' category I only considered rarley if ever.

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 I found interesting was to have the Game object delegate the Draw() and Update() methods to the objects themself ( Player, Invader, Bullet ) Also plan to use the Keyboarder structure to nicely package the functionality of detecting keyboard input.

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

@jasonpilz
jasonpilz / require.markdown
Last active February 9, 2016 20:38 — 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 maps, or corresponds to, a file.

Reference To: Sorting Algorithms in JavaScript

**Respond to this question in your fork: "What are some of the balances and trade offs between different sorting algoritms?"

###COMPARISON:

Bubble Sort Insertion Sort Merge Sort
Pros Easy to Implement
Stable sort
Good if short on space
Stable sort
Fastest
Cons
Not Stable sort
Slow as eff
Not good for large data Need lots of resources to use
O(n) O(n2) O(n2) O(n log n)

JavaScript Functions

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

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

I can explain what the value of this is when called from the context of an object.

I can explain how to explicitly set the value of this in a function.

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

Where are the methods available to all arrays (e.g. forEach, map, etc.) defined?

  • Array.prototype

- Mission

The purpose of this tutorial is to mimic setting up a DigitalOcean/AWS EC2/Linode server. The main advantages of having a virtual machine is that you can learn without worry of breaking things.

The first lesson will be all about getting familiar with a headless machine and getting a language we all know and love (ruby). Then we can mess around and try things out purely in the terminal.

The only three good options for a text editor are: emacs, vi, and vim. We will be using vim but vi itself is great and comes by default on Ubuntu 12.04.

Now you can practice getting used to ssh'ing into headless machines, using terminal based text editors, and using a terminal based window/session manager (tmux). The reason we have to use vim and tmux is that there is no X environment in a headless machine (the GUI, graphics, pretty things, etc..). The main reason for this is to save space on precious costly SSD data.

@jasonpilz
jasonpilz / capybara cheat sheet
Created January 14, 2016 02:35 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')