Skip to content

Instantly share code, notes, and snippets.

Everybody dreams about working with a team that is self-organising and high-performing.
In this talk, you will learn how to apply the principles of Autonomy, Mastery and Purpose
in the context of team building and culture. You will walk away with practical methods to
use these principles to make your team more self-organising.
I will explore:
* How to inject Autonomy into your team through Lean Startup and Product Thinking concepts.
* Instilling Mastery through utilising Agile and Data-Driven decision making.
* and, how to foster a sense of Purpose through the application of Goal Setting Theory and Vision Alignment.
@tsommer
tsommer / gist:2730303
Created May 19, 2012 09:56
Delayed Job exceptions with Airbrake
# Handle errors with Airbrake
Delayed::Worker.class_eval do
def handle_failed_job_with_airbrake(job, error)
handle_failed_job_without_notification job, error
# rescue if Airbrake fails for some reason
begin
Airbrake.notify error
rescue Exception => e
Rails.logger.error "Airbrake failed: #{e.class.name}: #{e.message}"
@tsommer
tsommer / gist:1005824
Created June 3, 2011 03:30
Tom's solution
def leaf_paths_of(paths)
paths.dup.reject do |path|
paths.any? { |p| p =~ %r{^#{Regexp.escape(path)}/} }
end
end
@tsommer
tsommer / gist:1005660
Created June 3, 2011 01:00
Given a list of directories, filter out all folders that have sub dirs
describe Library do
describe "leaf paths of" do
it "returns a path, if it doesn't have a sub dir in the list" do
Library.leaf_paths_of(["a"]).should == ["a"]
end
it "keeps unrelated paths" do
Library.leaf_paths_of(["a", "b"]).should == ["a", "b"]
end
@tsommer
tsommer / gist:992500
Created May 26, 2011 03:35
Given today's date and a weekday find the date of that weekday in the future (or today)
require 'time'
DAYS = {
"Sun" => 0,
"Mon" => 1,
"Tue" => 2,
"Wed" => 3,
"Thu" => 4,
"Fri" => 5,
"Sat" => 6
grammar Promo
rule root
empty rules:(trigger_or_effect empty)* {
def triggers
rules.elements.select { |r| r.elements.first.respond_to?(:trigger) }.map { |r| r.elements.first.trigger }
rescue NameError # nil for some object
[]
end