Skip to content

Instantly share code, notes, and snippets.

View tcocca's full-sized avatar

Tom Cocca tcocca

  • Boston Logic Technology Partners, Inc.
  • Boston, MA
View GitHub Profile
class Tom
attr_accessor :handle
def initialize
@handle = "tomcocca"
end
end
def update
@page = Page.find(params[:id[)
enforce_update_permission(@page) do
flash[:error] = "You can only edit your own pages"
redirect_to page_path(@page)
return
end
update!
end
# adapted from: http://github.com/railsmachine/shadow_puppet/blob/master/lib/shadow_puppet/core_ext.rb
require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/core_ext/array'
require 'active_support/inflector'
require 'active_support/core_ext/class/inheritable_attributes'
require 'active_support/core_ext/duplicable'
class Hash #:nodoc:
@tcocca
tcocca / rails_template.rb
Created October 4, 2009 17:31
My standard rails app template
# Tom's standard rails template
# Application Gems
gem "formtastic", :version => '>= 0.9.7'
gem 'will_paginate', :version => '~> 2.3.11'
gem "acts-as-taggable-on", :version => '>= 1.1.6'
gem "paperclip", :version => '>= 2.3.1.1'
gem "friendly_id", :version => '>= 2.3.2'
gem "inherited_resources", :version => '>= 1.1.0'
gem "thinking-sphinx", :lib => 'thinking_sphinx', :version => '>= 1.3.6'
Factory.define :application do |factory|
factory.attachment(:sample, "public/samples/sample.doc", "application/msword")
end
Upgrade System:
sudo apt-get update
sudo apt-get dist-upgrade
Standard Packages:
sudo apt-get install build-essential
Eye Candy: