Skip to content

Instantly share code, notes, and snippets.

View sgharms's full-sized avatar

Steven G. Harms sgharms

View GitHub Profile
class TimeGreeter
def initialize(time = Time.now)
@time = time.hour
end
def greet
puts "At the tone, the time of day is #{hour_word}"
end
private
@sgharms
sgharms / gist:8943777
Created February 11, 2014 20:46
minitest ships with 2.0
➜ fu irb -r 'minitest/autorun'
irb(main):001:0> class TestClass < Minitest::Unit::TestCase
irb(main):002:1> def test_fu
irb(main):003:2> assert true, "should be true"
irb(main):004:2> end
irb(main):005:1> end
=> nil
irb(main):006:0>
Run options: --seed 10470
class Sandwich
end
class GrilledCheeseMaker
def initialize(bottom_substrate, top_substrate, cheese_type, cook_type)
@bottom_substrate = bottom_substrate
@top_substrate = top_substrate
@cheese_type = cheese_type
@cook_type = cook_type

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@sgharms
sgharms / http.rb
Last active December 27, 2015 21:09 — forked from ravinggenius/http.rb
# My Thoughts on Greppability
#
# The code certainly *seems* greppable but let me stress the greppability a bit.... ;)
#
# ➜ 7390184 git:(master) ✗ ack put http.rb
# :put,
#
# Comment #1
# ==========
#
# Mocking a class method
product = Product.new
Product.expects(:find).with(1).returns(product)
assert_equal product, Product.find(1)
# Mocking an instance method on a real object
product = Product.new
product.expects(:save).returns(true)
assert product.save
@sgharms
sgharms / gist:5778875
Created June 14, 2013 01:50
Comparing to: http://localhost:4567/guides/getting-started/toggle-todo-editing-state I'm doing this on rails with the asset pipeline in an effort to play with Ember 1 some more before we do our upgrade at the end of the quarter. I was following along fine until I hit this one. I don't understand the magic of itemController enough but...it seems …
1 {{#each controller itemController="todo"}}
2 <li {{bindAttr class="isCompleted:completed isEditing:editing"}}>
3 {{#if isEditing}}
4 <input class="edit">
5 {{else}}
6 {{view Ember.Checkbox checkedBinding="isCompleted" class="toggle"}}
7 {{log this.constructor}}
8 {{log this.content.title}}
9 <!-- DOES NOT WORK
10 <label {{action "editTodo" on="doubleClick"}}>{{title}}</label><button class="destroy">>
@sgharms
sgharms / gist:5758773
Created June 11, 2013 17:15
Recruiting, you're doing it wrong:
INMAIL: YOU HAVE A NEW MESSAGE
From: Nick C*
Date: 6/11/2013
Subject: Hiring Mid to Sr. RoR Engineers - Rapidly Growing San Mateo SaaS Startup
Hi Steven,
App.ZazzumIndexRoute = Ember.Route.extend({
model: function() {
return App.Zazzum.find();
}
});
<script type="text/javascript">
/ <![CDATA[ /
var google_conversion_id = ....;
/ ]]> /
</script>
<script type="text/javascript" src="//some/script.js">
</script>
<noscript>
<div style="display:inline;">