{{ message }}

Instantly share code, notes, and snippets.

# Jacob Hodes peashutop

• Brooklyn
Created Mar 3, 2020
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:

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.

Created Nov 6, 2013
inline inject, but yucky style
View yucky-inline-inject.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 total_pony_count = farms.inject(0) do |counter, farm| counter += farm.pony_count end
Created Nov 6, 2013
with inject, no ceremony, just intention
View injected-ponies.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 def total_pony_count farms.inject(0) do |counter, farm| counter += farm.pony_count end end
Created Oct 27, 2013
inline injection, in style
View inject-in-style.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 total_pony_count = farms.inject(0) do |counter, farm| counter += farm.pony_count end
Last active Dec 26, 2015
without inject, too much ceremony
View uninjected-ponies.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 def total_pony_count total_ponies = 0 farms.each do |farm| total_ponies += farm.pony_count end total_ponies end
Created Sep 10, 2010
View test public.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 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 Then the reflection text for "1.1.3-reflection-self" should be 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." |
Created Feb 20, 2010 — forked from nkallen/Ruby Modularity
View Ruby Modularity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 [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