Skip to content

Instantly share code, notes, and snippets.

View sbellware's full-sized avatar

Scott Bellware sbellware

View GitHub Profile

Abstracts Submited to NDC 2014 in Oslo

Agile Kaizen

Kaizen is the unstated, ever-present cornerstone of Agile Development, but it's if often seen as distant and abstract thing rather than one of the tangible Agile practices, like standups, testing, or estimation. Seen as a "soft skill", Kaizen is in fact it's the hard science, the central motivator, the justification, and the traffic cop of other Agile practices. This presentation delivers Kaizen without the typical esoteric language, and re-casts it as the tangible, central aspect of Agile Development that all other practices pivot around. It presents the tools and techniques of Kaizen that you can put to work in your team right now in the pursuit of ever higher levels of performance.

TDD in Tatters

TDD has been tattered, torn, twisted, stood on its head, and pounded into an pulp of techno-fetishism. TDD was a game-changer, but the focus in the interceding years has shifted from technique to tools, and TDD has been devolving into a lost art. By tea

@sbellware
sbellware / example.rb
Last active August 29, 2015 14:01
Declaring null object default dependencies using @avdi's Naught library, and templated modules
class Example
include NullDefault[:some_dependency]
include NullDefault[:some_other_dependency]
end
@sbellware
sbellware / convenience.rb
Last active August 29, 2015 14:02
Initializers only record parameters
def Connection
def initialize(connection_string)
@connection_string = connection_string
end
def self.connect(connection_string)
instance = build connection_string
instance.connect
instance
end
class Ops::Diag::InfoController < Ops::Diag::DiagController
def index
release_info_file = File.expand_path("#{Rails.root}/config/release_info.yml")
@build_number = '(unknown)'
@build_date = '(unknown)'
@gems = '(unknown)'
if File.exists?(release_info_file)
data = YAML.load_file(release_info_file)
Hatchet.configure do |config|
config.level :warn
config.level :debug, 'Application::BankTransfer'
config.appender(Hatchet::LoggerAppender.new) do |appender|
appender.logger = Logger.new('log/application.log')
end
config.appender(CustomEmailAppender.new) do |appender|
appender.level :fatal
@sbellware
sbellware / perfection.md
Created July 22, 2014 15:19
The Purpose of Perfection - Much Ado About Agile 2014

The Purpose of Perfection


They say that "perfect is the enemy of the good". It's possible that their translation from French lacks some of the nuance of the original quote, and takes some license to rationalize a work management ideology where people who make decisions are insulated from suffering the consequences of those decisions. The typical diminishing returns of a software effort are not seen as a consequence of a poor understanding of perfection. There's a science to perfection, and western industry was taken by surprise by its competitive advantage

class Other
attr :x
end
# Pull (Ask, Instead of Tell)
self.x = other.x
# NOTE: The `other.x` retrieves a value from `other`. Therefore, it's a "query", or an "ask".
# Creates more coupling as `other` must expose a larger interface to cover all of the values
# to be pulled from it to be copied to other objects.
class SomeCommand
attr_accessor ...some attributes used by the command...
def initialize(...some initializer parameters...)
# Set the instance's attributes to the corresponding initializer parameters
end
def !
# This is the executor method (ie: the command's "raison d'etre")
# Do something here, making use of the parameters passed
@sbellware
sbellware / command_with_configuration.rb
Last active August 29, 2015 14:07
Configuring a Ruby Command Object
module Freendship
class Create
attr_reader :user_id
attr_reader: friend_id
# NOTE: null_attr creates an attr with a null object default value
null_attr :logger
null_attr :data_access
def initialize(user_id, :friend_id)
@sbellware
sbellware / prox_gem.rb
Last active August 29, 2015 14:09
References gems from path, git, or remote gem server based on configuration in environment variables
def prox_gem(gem_name, options={})
opts = _options(gem_name, options)
gem gem_name, opts
end
def _options(gem_name, options={})
mode = _prox_gem_mode
if mode == "path"
return { :path => _file_system_path(gem_name) }
elsif mode == "git"