Skip to content

Instantly share code, notes, and snippets.

#Lew's Opinionated Guide to Delivering Features#


  1. First, understand the story.

Do you understand the story completely? If not, talk to the product owner to clarify your understanding.

Is the story a logically cohesive grouping of functionality? If not, can it be broken into multiple stories?

Do the points assigned make sense given your current level of understanding of the story? If not, can it be broken into multiple stories?

=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')
class Sieve
attr_reader :values
def initialize(max)
@values = (2..max).to_a
end
def primes
values.each do |value|
class NilClass
def join
""
end
end
class Chunks
attr_reader :value
def initialize(value)
@garciadanny
garciadanny / say.rb
Created March 12, 2013 15:44
Katrina's Solution
class Say
attr_reader :value
def initialize(value)
@value = value
end
def in_english
guard_range
say_small_number || say_big_number
@garciadanny
garciadanny / word_problem.rb
Created March 6, 2013 16:41 — forked from jcasimir/word_problem.rb
REGULAR EXPRESSIONS
class WordProblem
attr_reader :equation
def initialize(equation)
@equation = equation
end
def answer
calculate
end
@garciadanny
garciadanny / FUNDAMENTAL SQL.md
Created March 1, 2013 21:27
FUNDAMENTAL SQL (Structured Query Language)

#FUNDAMENTAL SQL The most popular SQL-based databases include PostgreSQL, MySQL, Oracle, MS SQL Server, and SQLite.

Most databases store your data in a hidden-away part of your computer’s filesystem. You’d never interact with the data directly, only through the tools provided by the database engine. SQLite, instead, stores its data in a plain-text file. This makes it incredibly easy to move, rename, delete, or transfer the database.

###Experimenting with SQLite

  • Firing up the Sqlite db:

    • In the terminal: sqlite3 example.sqlite3
  • Creating a table in the terminal:

require 'time'
class Gigasecond
attr_reader :quantity
IN_SECONDS = 1_000_000_000
def initialize(quantity)
@quantity = quantity
end
@garciadanny
garciadanny / seconds_old.rb
Last active December 14, 2015 06:08 — forked from burtlo/example2.rb
require 'date'
# puts "What are you? #{ARGV} #{ARGV.class}"
# Called as in `ruby example2.rb 1977 10 30`
# birthdate = ARGV.map {|arg| arg.to_i }
birthdate = [ 1977, 10, 30 ]
# year, month, day = [ 1977, 10, 30 ]
# birth_in_seconds = Date.new(year,month,day).to_time.to_i
@garciadanny
garciadanny / refactor_sales_engine.rb
Last active December 14, 2015 03:39
Using the send method. (Refactoring Sales_Engine)
def self.most_revenue(number_of_results)
items = get_items_with_appropriate_values(:unit_price)
sort_and_return_items(items, number_of_results)
end
def self.most_items(number_of_results)
items = get_items_with_appropriate_values(:quantity)
sort_and_return_items(items, number_of_results)
end