Skip to content

Instantly share code, notes, and snippets.

Avatar

Jacob Hodes peashutop

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am peashutop on github.
  • I am jacob_hodes (https://keybase.io/jacob_hodes) on keybase.
  • I have a public key ASCgi9NoYi-FwRQh5cgUAcRzf2utJMt5xSzIKBSAN7OdVAo

To claim this, I am signing this object:

@peashutop
peashutop / clovis.md
Last active Aug 24, 2016
goat revisions
View clovis.md

Goats, Pizzas, Interviews

Part 1

Maria is delivering pizzas to an infinite two-dimensional grid of houses. She begins by delivering a pizza to the house at her starting location, then a dispatcher calls via radio and tells her where to move next. Moves are always exactly one house to the north (^), south (v), east (>), or west (<). After each move, Maria delivers a pizza to the house at her new location. The dispatcher has been a little spacey lately, so Maria sometimes ends up delivering more than one pizza to the same house.

@peashutop
peashutop / yucky-inline-inject.rb
Created Nov 6, 2013
inline inject, but yucky style
View yucky-inline-inject.rb
total_pony_count = farms.inject(0) do |counter, farm|
counter += farm.pony_count
end
@peashutop
peashutop / injected-ponies.rb
Created Nov 6, 2013
with inject, no ceremony, just intention
View injected-ponies.rb
def total_pony_count
farms.inject(0) do |counter, farm|
counter += farm.pony_count
end
end
@peashutop
peashutop / inject-in-style.rb
Created Oct 27, 2013
inline injection, in style
View inject-in-style.rb
total_pony_count =
farms.inject(0) do |counter, farm|
counter += farm.pony_count
end
@peashutop
peashutop / uninjected-ponies.rb
Last active Dec 26, 2015
without inject, too much ceremony
View uninjected-ponies.rb
def total_pony_count
total_ponies = 0
farms.each do |farm|
total_ponies += farm.pony_count
end
total_ponies
end
View test public.feature
Feature: 1.1.3-reflection-self
Scenario Outline: reflection text based on valid answer to previous question
Given prior node "1.1.3-self" has the answer <answer>
Then the reflection text for "1.1.3-reflection-self" should be <reflection_text>
Scenarios:
| answer | reflection_text |
| 1 | "So, you were able to talk about yourself without too much stress." |
| 2 | "So, you were able to talk about yourself without too much stress." |
| 3 | "So it sounds like it was somewhat hard to talk about yourself." |
| 4 | "So it sounds like it was somewhat hard to talk about yourself." |
View Ruby Modularity
[7:25pm] nkallen_: [7:18pm] nkallen_: but my point is conceptual and not about ruby
[7:25pm] nkallen_: [7:18pm] nkallen_: it applies to every oo language and also I might argue to functional languages
[7:25pm] nkallen_: [7:18pm] nkallen_: which is to structure a program around the ability to layer on enhanced functionality and ensure that no assumptions are hardcoded by abstracting over the manufacture of objects
[7:25pm] nkallen_: [7:19pm] nkallen_: in the literature, these techniques are called DI, decorators, and factories.
[7:25pm] nkallen_: [7:20pm] nkallen_: i like these terms because they reflect the concepts that are at work. because ruby might have little ceremony (you don't ever need to name a thing "Factory") doesn't mean the concept of "any object that responds to #new and returns an object that obeys such-and-such ducktype"
[7:25pm] nkallen_: [7:20pm] nkallen_: is not a real and useful concept to think about.
[7:26pm] wycats_: My concern is about adoption
[7:27pm] wycats_: By calling these thin