Skip to content

Instantly share code, notes, and snippets.

Study these screenshots:

https://innig.net/tmp/nr-screenshots/

Fork this gist (one fork per team).

Sketch out an object model for this application. Don't worry about view, network, database, etc.; your concern is only to represent the essential information of this application as classes and attributes. You can use the following attribute types:

  • numbers, strings, dates
  • other model classes
class Recording < ActiveRecord::Base
has_many :artistic_contributions, dependent: :destroy, include: [:artistic_role, :artist]
has_many :artists, through: :artistic_contributions
has_many :editions, class_name: 'RecordingEdition', dependent: :destroy
has_many :blog_posts, foreign_key: :podcast_recording_id
validates :title, :base_file_name, presence: true
before_save :refresh_editions
@pcantrell
pcantrell / gist:4113853
Created November 19, 2012 21:01
Property observers in Javascript
// Model with property observers:
Model = function() {}
Model.prototype.observe = function(prop, observer) {
this._observers = this._observers || {}
if(!this._observers[prop]) {
this._observers[prop] = []
@pcantrell
pcantrell / ruby-closures.rb
Created January 8, 2012 21:07
Closures in Ruby
# CLOSURES IN RUBY Paul Cantrell http://innig.net
# Email: username "cantrell", domain name "pobox.com"
# I recommend executing this file, then reading it alongside its output.
#
# Alteratively, you can give yourself a sort of Ruby test by deleting all the comments,
# then trying to guess the output of the code!
# A closure is a block of code which meets three criteria:
@pcantrell
pcantrell / Gemfile
Created November 29, 2011 17:42
Get app profiling straight from the browser. Usage: (1) http://localhost:3000/rubyprof/start (2) Exercise slow requests (3) http://localhost:3000/rubyprof/stop (be patient) to get a report.
gem 'ruby-prof'