Skip to content

Instantly share code, notes, and snippets.

View toolmantim's full-sized avatar
:shipit:
🎉

Tim Lucas toolmantim

:shipit:
🎉
View GitHub Profile

Improving cucumber output

We want to reduce cucumber's signal to noise ratio--currently errors are hidden within pages and pages of success.

You don't care in detail about what has passed, simply that stories ran and passed. What you care about is which scenarios no longer work, have broken, need updating or aren't yet complete.

How it'll work

# Example simple stupid in-memory cache
class HashCache
def initialize(seconds_timeout)
@seconds_timeout = seconds_timeout
@cache = {}
end
def fetch(key, &block)
if @cache[key] && fresh?(@cache[key][:set_at])
return @cache[key][:value]
else

Why build a site? Why do your customers care?

The core purpose of a website is to help your customers answer the questions necessary to do business with you.

If your website is a series of answers to questions then the success of your site depends on what questions you answer--it's the questions and answers that show the customer you provide a service they're looking for, you're a good choice and that they should buy from you.

In general every customer has the following questions:

  1. Who are you?
  2. What do you offer?
# Downloads all the photos from a flickr set
require 'open-uri'
require 'rubygems'
require 'flickr-rest' # benschwarz-flickr-rest
Flickr::Query::API_KEY = 'your key, yo.'
Flickr::Query.new('57794886@N00').
class CuratorialContentFinder
include SemiAutomated
include CuratorialContentFinderFinder
include CollectiveConsciousness
include FrontalLobe
def recommend_related_article(article)
recommendations = network.advise_recommendations(article)
frontal_lobe.analyze(recommendations).recommended_article
end
class WarOccupationTypeGame
include TwitterIntegration
include GamingEngine
include HTMLisedMap
include Europe
include CollectiveConciousness
attr_accessor :player, :scoreboard, :europe, :map
def receive(tweet)