Skip to content

Instantly share code, notes, and snippets.

@theirishpenguin
theirishpenguin / raffle.rb
Created August 25, 2014 08:18
A simple script to run a raffle, reading in from a CSV file of contestants
# quick-and-dirty Ruby script to raffle a prize
# author: Kevin Noonan.
# modified for suspense by theirishpenguin :)
#
# State in advance: attendance at the event is mandatory to be
# eligible for the prize-draw.
# If someone who's not attending is randomly chosen, re-run the script.
#
# (The list below has *all* Ruby Ireland members, at least on Meetup
# as at 15th April 2013.)
@theirishpenguin
theirishpenguin / backbone-paginator-2.0.2-penguin1.js
Created December 15, 2014 15:18
backbone-paginator-2.0.2-penguin1
/*
backbone.paginator 2.0.0
http://github.com/backbone-paginator/backbone.paginator
Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
Licensed under the MIT @license.
*/
(function (factory) {
Ya, there are a few good interactor based gems floating around, including collectiveideas. I usually just apply the basic pattern discussed at https://www.youtube.com/watch?v=WpkDN78P884 ie. instead of object 1 and 2 talking to each other, introduce a third object to facilitate the communication. So this can be a Service object, or just another object.
I guess if that third object isn't quite at the Service level it's just another object - ie. in the case of an Interactor that depends on another Interactor, the top-level Interactor is a Service Object and the lower level Interactor is just another object. This scenario isn't common but by not assuming that every Interactor is a Service Object you reserve the right to do keep applying this technique to simplify code in a complex scenario.
So introducing a higher-level third object helps solve fat controllers/models in Rails, which would otherwise be too tightly coupled to each other and harder to test. And introducing a higher-level third object helps solve
@theirishpenguin
theirishpenguin / Masters Opportunity on Gaming and Its Use in Youth Work
Last active August 29, 2015 14:22
Masters Opportunity on Gaming and Its Use in Youth Work
### Masters Opportunity on Gaming and Its Use in Youth Work ###
Just circulating an opportunity to do a Masters to investigate the use of multiplayer online games as a means of engaging young people in youth work. It's a scholarship with the fees for 2 years paid and a stipend to the value of 6000 euro per annum provided.
*** The closing date for applications is soon - 12th June ***
The Masters will be done via the Limerick Institute of Technology, in partnership with Tipperary Regional Youth Services, who are looking for someone with either skills in youth work and interest in gaming, or skills in gaming/programming with an interest in youth work.
More details and candidate requirements at http://bit.ly/1JnLPNM