Skip to content

Instantly share code, notes, and snippets.

View dgmstuart's full-sized avatar

Duncan Stuart dgmstuart

View GitHub Profile
The Chase, Canon, Wedge formation, Mime, Circle formation, Props, The Pancake (aerial), Leapfrog ('Hoppa bock'), Costume change, Shorty George, Metallic shoes, Mixed-nationality team, All-Swedish Team, A Lithuanian not in Lithuania, An American not in America, Somebody falls, 3 Swingouts and a Circle, Everyone is wearing green, A leader in white trainers, A Minnie Dip, Somebody is upside-down, A jam circle, Braces (suspenders), The Snatch (aerial), The Lindy flip/ Lamppost/ Around the back (aerial), Square formation, Diamond formation, Swingouts in opposite directions, Hacksaws, Standing on shoulders, Sitting on shoulders, Everyone jumps at the same time, Syncopated clapping, An aerial involving more than two people, Coochie toss/ Fly toss (aerial), Male follower, Female leader, Everyone wearing brown, "Acting", Mid-routine song change, Somebody you have personally taken class from, A hat, 16 or more people on stage, Brightly coloured trousers, An odd number of people on stage, Slow motion, Waterfall (aerial)
@dgmstuart
dgmstuart / good_advice.md
Last active July 13, 2018 09:04
Good Advice I Have Received
  • ABC (Always Be Charging)
  • If you're not sure what to say in a conversation, ask someone about what they know. People love to talk about things they know about.
  • Nobody really minds if you don't got to the party.
@dgmstuart
dgmstuart / soldn_rollbar_groupings.json
Last active November 17, 2017 10:27
Rollbar groupings for swing out london
[
{
"condition": {
"all": [
{
"any": [
{
"eq": "ActionController::RoutingError",
"path": "body.trace.exception.class"
},
@dgmstuart
dgmstuart / talks.md
Last active February 14, 2016 21:08
Conference talks
@dgmstuart
dgmstuart / 1.9.3-p551
Created November 27, 2015 21:02
foundation-rails helper gemfile
PATH
remote: .
specs:
foundation_rails_helper (1.0.0)
actionpack (~> 4.1)
activemodel (~> 4.1)
activesupport (~> 4.1)
railties (~> 4.1)
tzinfo (~> 1.2, >= 1.2.2)

Dependency Injection in Ruby 07 Oct 04

Introduction

At the 2004 Ruby Conference, Jamis Buck had the unenviable task to explain Dependency Injection to a bunch of Ruby developers. First of all, Dependency Injection (DI) and Inversion of Control (IoC) is hard to explain, the benefits are subtle and the dynamic nature of Ruby make those benefits even more marginal. Furthermore examples using DI/IoC are either too simple (and don’t convey the usefulness) or too complex (and difficult to explain in the space of an article or presentation). I once attempted to explain DI/IoC to a room of Java programmers (see onestepback.org/articles/dependencyinjection/), so I can’t pass up trying to explain it to Ruby developers.

Thanks goes to Jamis Buck (the author of the Copland DI/IoC framework) who took the time to review this article and provide feedback.

What is Dependency Injection?

@dgmstuart
dgmstuart / test_case.rb
Created June 23, 2015 01:31
Rails presenter - failing test case
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '4.2.2'
@dgmstuart
dgmstuart / composer.lock
Created June 18, 2015 14:05
dunit + phpunit lockfile
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "37d741385deb98641a888b011966b466",
"packages": [],
"packages-dev": [
{
@dgmstuart
dgmstuart / gist:33eeb05638bfebdc04db
Last active August 29, 2015 14:17
Javascript errors on Ryanair payment
First error: https://www.bookryanair.com/SkySales/Booking.aspx?culture=en-GB&lc=en-GB#Payment
GET https://www.bookryanair.com/cb/qv49l7bp/3515927592/check.js?_=1426706153419 jquery.min.js:6
x.ajaxTransport.send jquery.min.js:6
x.extend.ajax jquery.min.js:6
x.extend._evalUrl jquery.min.js:6
x.fn.extend.domManip jquery.min.js:5
x.fn.extend.append jquery.min.js:5
(anonymous function) jquery.min.js:5
x.extend.access jquery.min.js:4
@dgmstuart
dgmstuart / Sandboxes.md
Last active August 29, 2015 14:16
Resources for teaching kids to code