Skip to content

Instantly share code, notes, and snippets.

View jordanpoulton's full-sized avatar

Jordan Poulton jordanpoulton

View GitHub Profile
#!/usr/bin/env ruby
class Manager
def pick_a_team(squad)
team = Team.new
# get the best players for every position from the squad
# and add them to the team
# for every position (goalkeeper etc)
# get the best player(s) from the squad
@jordanpoulton
jordanpoulton / cake.rb
Created February 27, 2013 18:05
A programme that bakes an Umbongo flavoured cake then bakes one for you...
#!/usr/bin/env ruby
class Order
def initialize(cake_flavour)
puts "----------------->You've initialised a new order for a cake"
puts "
You want a #{cake_flavour} flavoured cake?
@jordanpoulton
jordanpoulton / team_picker.rb
Created February 27, 2013 18:52
Give it a few weeks and we'll be selling this to Premier League clubs ;)
#!/usr/bin/env ruby
class Manager
def initialize
puts "Manager initialised"
end
def pick_a_team(squad, d, m, a)
team = Team.new
@jordanpoulton
jordanpoulton / cake.rb
Created March 4, 2013 17:57
Cake script
#!/usr/bin/env ruby
class Order
def initialize(cake_flavour)
puts "----------------->You've initialised a new order for a cake"
puts "
You want a #{cake_flavour} flavoured cake?
@jordanpoulton
jordanpoulton / practise_1.rb
Created March 4, 2013 17:59
Practise from Well grounded Rubyist
class C
puts "Just started class C"
puts self
module M
puts "Nested module C::M"
puts self
end
puts "back in the outer level of C:"
@jordanpoulton
jordanpoulton / practise_2.rb
Created March 4, 2013 17:59
Practise 2 from Well Grounded Rubyist
class Car
#CLASS LEVEL VARIABLES AND METHODS
@@makes = []
@@cars = {}
def self.total_count #ATTRIBUTE READER
@total_count ||= 0
end
@jordanpoulton
jordanpoulton / preferences_sublime.rb
Created March 4, 2013 18:25
Sublime Jordan User Preferences
{
"color_scheme": "Packages/Color Scheme - Default/jordan.tmTheme",
"command": "save_all",
"ensure_newline_at_eof_on_save": true,
"font_size": 10.0,
"ignored_packages":
[
"Vintage"
],
"keys":
[
/* BEGIN: blockers */
{ "keys": ["alt+a"], "command": "insert_snippet", "args": {"contents": "=>"} },
{ "keys": ["alt+s"], "command": "insert_snippet", "args": {"contents": "."} },
{ "keys": ["alt+d"], "command": "insert_snippet", "args": {"contents": "/"} },
{ "keys": ["alt+f"], "command": "insert_snippet", "args": {"contents": ";"} },
{ "keys": ["alt+g"], "command": "insert_snippet", "args": {"contents": ":"} },
{ "keys": ["alt+h"], "command": "insert_snippet", "args": {"contents": "\"$0\""} },
{ "keys": ["alt+j"], "command": "insert_snippet", "args": {"contents": "[$0]"} },
{ "keys": ["alt+k"], "command": "insert_snippet", "args": {"contents": "{$0}"} },
@jordanpoulton
jordanpoulton / massage.rb
Created March 22, 2013 13:55
Makers Academy Massages
# 12 slots, 2 for winners, 1 for teachers, 7 cohort one, 4 in cohort 2
cohort_1 = [:Michelle, :Max, :Jordan, :Pat, :Vish, :Rich, :Alex, :Mark]
benched = [:RobB, :Chris]
cohort_2 = [:Zahid, :Aled, :Dario, :Sam, :Ruben]
teachers = [:Evgeny, :Leo, :RobJ, :Ben, :Ana ]
everyone = cohort_1 + benched + cohort_2 + teachers
@jordanpoulton
jordanpoulton / pair_programming_roles
Last active September 16, 2024 19:06
Pair Programming Role Definitions - Driver:Navigator
Driver:
-Write the code according to the navigator's specification
-Listen intently to the navigators instructions
-Ask questions wherever there is a lack of clarity
-Offer alternative solutions if you disagree with the navigator
-Where there is disagreement, defer to the navigator. If their idea fails, get to failure quickly and move on
-Make sure code is clean
-Own the computer / keyboard
-Ignore larger issues and focus on the task at hand
-Trust the navigator - ultimately the navigator has the final say in what is written