Skip to content

Instantly share code, notes, and snippets.

View tooky's full-sized avatar

Steve Tooke tooky

View GitHub Profile
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))))
Host pairhost2
Hostname lin.one42.co.uk
User mattwynne
Port 10022
RemoteForward localhost:22222 localhost:22
Host *.pair2
ProxyCommand ssh -e none -ax pairgate nc -w 5 localhost %p 2>/dev/null
User pairing
LocalForward localhost:3000 localhost:3000
require 'delegate'
class ProtectionProxy < SimpleDelegator
def initialize(object, *writable_fields)
super(object)
@writable_fields = writable_fields
end
def method_missing(method, *args, &block)
method_name = method.to_s
if !method_name.end_with?('=')

Ragir S. 2000 Evolutionary Anthropology 9(4) 153-5

Abstract

At least four innovations in nutrient sources, preparation, and distribution underlie the transformation of our evolutionary ancestors into modern humans: the digging, preparation, and consumption of tubers and rhizomes; the technological mediation of hunting and butchering of animal prey; the socially mediated redistribution of animal prey; and the control of fire for cooking. The emergence of technologies for processing hard-to-obtain or difficult-to-digest foods such as animal protein, savanna tubers,

@tooky
tooky / card_creator.rb
Created July 6, 2012 20:52 — forked from gma/card_creator.rb
Moving response callbacks out of controller
class CardCreator < Struct.new(:listener)
def create(iteration, attributes)
card = iteration.cards.build(attributes)
if card.save
listener.created(card)
else
listener.create_failed(card)
end
end
end
@tooky
tooky / sketch.rb
Created June 29, 2012 15:46 — forked from mattwynne/sketch.rb
sketch for Matt Wynne
class Organization
def to_param
"42"
end
def saved?
rand > 0.5
end
end
# ADD LOCAL CONFIGURATION HERE
[diff]
[color]
diff = auto
status = auto
branch = auto
[core]
editor = vim
[alias]
st = status