Skip to content

Instantly share code, notes, and snippets.

View peashutop's full-sized avatar

Jacob Hodes peashutop

View GitHub Profile
[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
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." |
@peashutop
peashutop / uninjected-ponies.rb
Last active December 26, 2015 16:09
without inject, too much ceremony
def total_pony_count
total_ponies = 0
farms.each do |farm|
total_ponies += farm.pony_count
end
total_ponies
end
@peashutop
peashutop / inject-in-style.rb
Created October 27, 2013 04:23
inline injection, in style
total_pony_count =
farms.inject(0) do |counter, farm|
counter += farm.pony_count
end
@peashutop
peashutop / injected-ponies.rb
Created November 6, 2013 14:49
with inject, no ceremony, just intention
def total_pony_count
farms.inject(0) do |counter, farm|
counter += farm.pony_count
end
end
@peashutop
peashutop / yucky-inline-inject.rb
Created November 6, 2013 14:52
inline inject, but yucky style
total_pony_count = farms.inject(0) do |counter, farm|
counter += farm.pony_count
end
@peashutop
peashutop / clovis.md
Last active August 24, 2016 21:59
goat revisions

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.

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: