Skip to content

Instantly share code, notes, and snippets.

@stevenjackson
stevenjackson / select_option_parsing
Created November 12, 2012 22:22
Getting option index off a select in page_object/watir environment - use with invisible selects
#Page object way
(rdb:1) option_index = pay_type_element.options.find_index{ |e| e.text == 'Credit card' }
2
#Watir-webdriver ways
(rdb:1) option_index = pay_type_element.option(:value, "Credit card").index
*** DEPRECATION WARNING
*** You are calling a method named option at /Users/stevejackson/projects/cucumber-and-cheese/test_puppies/features/support/pages/checkout_page.rb:16:in `checkout'.
@stevenjackson
stevenjackson / gist:4166636
Created November 29, 2012 03:36
Create a hash of a symbol and method result (used for property like syntax in ruby files, where symbols are define_method'd as accessors
hash_syms :yo, :foo
def hash_syms(*args)
hash = {}
args.each do |arg|
hash[arg.to_sym] = self.send "#{arg}"
end
p hash
end
@stevenjackson
stevenjackson / gist:4225614
Created December 6, 2012 16:06 — forked from joelbyler/gist:4225565
Cucumber Rerun Rake Task
require 'cucumber/rake/task'
def run_rake_task(name)
begin
Rake::Task[name].invoke
rescue Exception => e
return false
end
true
end
@stevenjackson
stevenjackson / gist:5088077
Created March 5, 2013 04:44
Highlight for keynote pres
pbpaste | highlight --syntax=rb -O rtf high.rb | pbcopy
@stevenjackson
stevenjackson / functional_query.rb
Last active October 9, 2016 02:12 — forked from searls/market_research.rb
Was chatting with @mfeathers about retaining Ruby's chained Enumerable style, but finding a way to inject names that reflects the application domain (as opposed to just littering functional operations everywhere, which may be seen as a sort of Primitive Obsession)
module FunctionalQuery
def initialize(collection)
@collection = collection
end
def result
@collection
end
def average_by_attr(attr)
@stevenjackson
stevenjackson / code.md
Last active November 12, 2016 02:31
Code: Debugging the Gender Gap

"The jobs are here, we don't have the workers to fill them"

Review

  • It was good, I'm glad I saw it. I'm not sure who the intended audience was, sometimes young women, sometimes corporate leaders?
  • The first half of it didn't keep my attention, but it's a nice intro if you don't understand why this is important and the importance of women to the field.
  • The second half was much more powerful to me, more current examples of women trying to fight "the man" and why it's hard.
  • They touched lightly on solutions, but it was kinda disappointing. Fight stereotypes, create more role models.
  • The only solution presented for a company: Spend lots of money, recruit out of bootcamps, grow talent, fight to retain.
  • http://shescoding.org/ for more.
@stevenjackson
stevenjackson / efficiency.md
Created December 7, 2016 15:45
Agile Efficiency

"Today I read the statement, "It's hard to achieve agility with efficiency", and wondered, "is that a reasonable objective?" - Thoughts?" - @DocOnDev

I've given this a lot of thought in an unlikely context: home maintenance.

I have two young kids, so it's not realistic that I'll get an uninterrupted daylight hour on the weekend. Yet, there is a pile of stuff I want to get done. If I apply a slice and dice mentality, I can accomplish most things, but I'm always grossly inefficient. For instance, this weekend I wanted to hang lights. It's annoyingly inefficient to pack and unpack the ladder multiple times, yet I have to do it, because I can't be sure I'll be able to get back to it. Also I'd like to test-drive my lights (since my "normal" feedback loop might be days long). If I hang "the most valuable" section, I need a very long extension cord. To reach those lights, I'll also have to leave this cord in an obvious and "ugly" place.

So my observations are that that agile/incremental/verifiable work req

@stevenjackson
stevenjackson / failure.md
Last active February 13, 2017 01:45
Looking for Failure

Abstract

Do you avoid failure? Learn to succeed by embracing failure!

Discover how you can use failure to learn faster, build resilient software, and enable innovative teams. Learn how cognitive biases make failure seem unattractive. Explore experimenting with failure to overcome this stigma and supercharge learning. Investigate the skills to reframe failure and enable a mindset and culture suitable for success in a world full of random events.

Summary

Failure provides critical feedback, but we're conditioned to avoid it at all costs and forget it quickly when it happens. How can we challenge this natural human bias? I've spent the last couple years digging into "pop" psychology and thinking about how books like "Thinking Fast and Slow", "Antifragile", "Drive", "Blink", and "Outliers" apply in a software development environment. I'm most excited about the idea that if we can make failure "safe" then we can use it to learn things that we would otherwise be tempted to avoid and ignore because it mi

@stevenjackson
stevenjackson / td_mini_conf.md
Last active December 18, 2017 17:44
Notes from TD mini-conference on 14Dec2017

Empathy, Boldness and Boundaries:

@marcpeabody

Crucial Conversations

  1. How to avoid crucial conversations?
  2. What leads to them in the first place?

If you're like this when you're ok, you're going to be kinda like this when you're stressed

@stevenjackson
stevenjackson / abstract.md
Created January 29, 2018 14:22
DevOps for the Perplexed

DevOps for the Perplexed

Containers, Swarms, Infrastructure as Code - it all sounds neat, but maybe a bit overwhelming? We just chef-ized our configs, but we can't deploy until we terraform something? There's a new tool every month, how do you keep up? You try to read the docs, but it sounds like they all do the same thing - why do we need to add another tool? Let's start with an example web app and try to get it running on someone else's machine. As I run through a number of deployment problems, I'll pull a tool off the shelf and show how it addresses that problem, and probably create a few more.

You'll walk away with an understanding of each class of tool and the one-thing it's best at. With that knowledge you can determine which tools can benefit your current projects and which are solving problems you just don't have yet.