James Starmer


Retropective Closing Activity: Smilies on the Door

May 17, 2014 1 minute read

Example

In Agile Retrospecives by Esther Derby and Diana Larsen, retrospectives end with a closing activity.

Closing the retrospective provides moments for continuous improvement, for reflecting on what happened during the retrospective, and for expressing appreciation.

I’ve recently lead a few retrospectives with teams that are new to a five step retrospective. I wanted to keep the closing activity as quick and painless as possible. I found an activity on plans-for-retrospectives.com called Feedback Door - Smilies. I modfied this a bit for the retrospecitves I led.

Smileys on the Door

  1. Hand out stickies and sharpies to all of the participants.
  2. Draw a smiley face :), meh face :| and a frowny face :( on a whiteboard or a stickes so everyone can see.
  3. Explaing that, “This last activity is to close and gather feedback on this retrospective. Take a moment to think about the retrospective as a whole and then draw a smiley that represents how you feel. How did you feel about the activities? How did you feel about the things we decided to do? When you are finished, you can stick your smiley on the door as you leave.”

Cross-domain ajax without jsonp using a ruby proxy

August 17, 2013 1 minute read

Browsers build in a security feature which stops a web page from submitting ajax requests from another domain. So if a page is running on jamesstarmer.com/example.html it can only call pages on the jamesstarmer.com domain, requests to google.com/some-api/whatever.json will fail. The best way to get around this is to use JSONP which loads json using a script tag which is ok by browser security standards.

Back before JSONP was a “thing” I had a need to get and ajax request from domain a to domain b. At the time I was writing the server side code in PHP and I quickly found a “proxy” script. The script is extremely simple. You run the script on the domain that the page is on, you pass in a URL that isn’t in the current page’s domain that you want to load, it reads that page on the server side and then spits out the result.

I recently ran into a need for this while working on the dashboard project. A bamboo server was upgraded to a new version and JSONP stopped working. Instead of waiting for an upgrade / fix, I just implemented a simple proxy similar to the one I had used in PHP many years ago. The following code is for rails but it could easily be ported to sinatra, etc.

require 'open-uri'

class ProxyController < ApplicationController
  def index
    url = request.fullpath.split("/proxy?url=")[1]
    render :text => open(url).read
  end
end

The javascript code is as simple as

$.ajax({
  url: "/proxy?url=http://www.some-other-domain.com/api/x.json",
  contentType: "application/json",
  dataType: "json",
  success: function(response){
    console.log(response)
  }
});

Tracking Team Morale

July 26, 2013 1 minute read

Example

In a recent retrospective a question came up about morale. That triggered a memory about an activity for tracking the mood of a team. I tried to recreate the activity as best as I on the spot. This is how it went. We passed around sticky notes, everyone drew a smile, meh, or frown face to capture their overall mood from the previous sprint. The papers were folded / crumbled to keep them anonymous. The votes were then tallied and then we discussed the results.

Obviously this method of capturing morale can lead to skewed results. It’s hard to sum up or even remember all of the things that affect your mood during a sprint. If someone is really happy or mad on the day of the retrospective, that might lead to an overall mood that doesn’t take into account the other days of the sprint.

Since I’m a Software Engineer my mind naturally jumps to solving this problem with software. So I wrote up a little application to track my team’s happiness. The code is available at github. A demo is available here.

The inspiration for this comes from the niko-niko calendar. One major difference is that this project is designed to “anonymously” track moods. Data is captured at a cookie level to link a single users stats over time, but there is nothing that will identify that person beyond what the put in their notes field.

My team just started using it halfway through this sprint so it has yet to prove itself useful. However it turns out, it was a fun bit of code to hack on.

Example


try bash function

July 15, 2013 1 minute read

This function will echo a command it’s about to run, run it and exit if the command failed. This will allow a script to execute many commands but if a single command fails, the script will stop. The echoing of the command provides feedback while the script is running and it also makes it clear when failures occur.

try() {
  echo "running: [$@]"
  $@
  (( $? )) && exit $?
}

Example usage

try echo "testing"
try commandthatwillfail
try echo "this won't show up"

Example output

running: [echo testing]
testing
running: [commandthatwillfail]
./test.sh: line 3: commandthatwillfail: command not found

xargs

July 11, 2013 1 minute read

There are two things that I run into that I think xargs should easily handle, changing the position or order of the arguments it adds and acting like a loop over multiple lines of inputs. Typically I’m in a rush and I’ll just figure out another solution instead of opening up the man page or searching the internet for a solution. After running into the need again, I decided to stop being lazy, figure it out and document what I found so that I won’t have an excuse in the future.

Given that we have a directory with a few files in it

$ ls
a b c

When I want to use each of those files as a argument to a command I could use a loop like while or for, or I could use xargs with -I like this

ls | xargs -I@ echo @ "is a letter"
a is a letter
b is a letter
c is a letter

The -I in this case means, for each input line, replace the @ symbol with the line and carry on with the rest of the command.

If you only want to run the command once, but the arguments need to be at a specific position in the call you can use -J

ls | xargs -J@ echo @ "are at the beginning of the alphabet"
a b c are at the beginning of the alphabet

And if you want the arguments to fall at the end of the call, you can just use the default behaviour

ls | xargs echo "the first three letters in the alphabet are"
the first three letters in the alphabet are a b c

There is still a lot more to xargs, but these are the typical uses I’ve found a need for.