Skip to content

Instantly share code, notes, and snippets.

View tooky's full-sized avatar

Steve Tooke tooky

View GitHub Profile
@tooky
tooky / variables.rb
Last active December 24, 2015 03:59
# Fill in the values after # =>
#
$title = "Ruby Variables"
@subtitle = "Where do they come from?"
presenter = "@tooky"
class Presentation
@@length = "10 min"
@style = "Code"
@tooky
tooky / 1-homework.md
Last active December 23, 2015 21:29
On The Beach Academy - Homework

Week 1 Homework

  • Complete the ruby koans
  • Use RSpec to test-drive a solution to either:
  • Write a 10 minute presentation about the topic card you pick
  • BONUS: clone Corey Haines' [practice repo] [1], and use it to help you complete a Game of Life solution.
    • You will need to research [cucumber] [2] and [bundler] [3]
  • Use cucumber and rspec to help guide your code
require 'minitest'
module Cucumber
module MiniTestAssertions
def self.extended(base)
base.extend(MiniTest::Assertions)
base.assertions = 0
end
attr_accessor :assertions
end
@tooky
tooky / gist:5933457
Last active December 19, 2015 09:29
module MiniTestAssertions
def self.extended(base)
base.extend(MiniTest::Assertions)
end
attr_accessor :assertions
end
World(MiniTestAssertions) # this will work
% VIEW_OTHER_WARNINGS=true rake ~cucumber/cucumber-ruby-core (master)
/opt/rubies/ruby-1.9.3-p392/bin/ruby -w -r./capture_warnings -S rspec ./spec/cucumber/core/ast/background_spec.rb ./spec/cucumber/core/ast/doc_string_spec.rb ./spec/cucumber/core/ast/examples_table_spec.rb ./spec/cucumber/core/ast/outline_step_spec.rb ./spec/cucumber/core/ast/step_spec.rb ./spec/cucumber/core/ast/table_spec.rb ./spec/cucumber/core/compiler_spec.rb ./spec/cucumber/core/gherkin/parser_spec.rb ./spec/cucumber/core/gherkin/writer_spec.rb ./spec/cucumber/core/test/case_spec.rb ./spec/cucumber/core/test/result_spec.rb ./spec/cucumber/core/test/step_spec.rb ./spec/cucumber/core/test/suite_runner_spec.rb ./spec/cucumber/core_spec.rb ./spec/cucumber/initializer_spec.rb --color
......................................................................................................................
------------------------------ other warnings: ------------------------------
/U
class AccountSignup
def self.new(warden, acccount_params)
account = Subscribem::Account.create(account_params)
account.create_schema
UserSignup.new(warden, account, account.owner)
end
end
module Context
def the(key, value)
context[key] = value
end
def method_missing(method, *args, &block)
key = extract_key(method)
if key
context.fetch(key.to_sym)
else
@tooky
tooky / gist:3959276
Created October 26, 2012 14:59 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
@tooky
tooky / gist:3840466
Created October 5, 2012 15:21
BritRuby Talk Proposal - East Oriented Rails

Steve Tooke: East Oriented Rails

James Ladd proposes a compass that we can use to navigate our object-oriented designs. We move North as we travel up a layer, South as we travel down a layer. West will take us away from the object, and East moves us towards another object.

James suggests that we orient our code so that we are always travelling East. In practice this means that code should follow these rules:

  1. All public methods return nil, boolean or return a reference to the current object (self).
  2. Objects that implement the Factory or Builder pattern or similar are an exception.
  3. East is better suited to composite objects, not primitive objects (James doesn’t make this distinction).
@tooky
tooky / differences-between-a.clj
Created September 11, 2012 07:26
Working through FP for OO Programers by @marick
;solution presented
(def a
(fn [type & args]
(apply type args)))
;my original solution
(def a
(fn [type & args]
(eval (cons type args))))