Skip to content

Instantly share code, notes, and snippets.

View jeremy6d's full-sized avatar

Jeremy Weiland jeremy6d

View GitHub Profile
In body.html:
<%= select_field_view :store,
:name_key => 'name',
:value_key => 'guid',
:sort_key => 'name',
:empty => 'Select a store',
:bind => {
:value => 'TestHarness.storesController.selection',
:objects => 'TestHarness.storesController.arrangedObjects'
Loading development environment (Rails 2.2.2)
>> Numeric.subclasses
=> ["Bignum", "Float", "Fixnum", "Integer", "Rational", "Date::Infinity", "BigDecimal"]
>> PortfolioCategory.superclass
=> ActiveRecord::Base
>> TypeCategory.superclass
=> PortfolioCategory(id: integer, name: string, description: text, type: string, created_at: datetime, updated_at: datetime, slug: string)
>> PortfolioCategory.subclass
NoMethodError: undefined method `subclass' for #<Class:0x19f4588>
from /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb:1833:in `method_missing_without_paginate'
Loading development environment (Rails 2.2.2)
>> PortfolioCategory.send(:subclasses)
=> []
>> TypeCategory.superclass
=> PortfolioCategory(id: integer, name: string, description: text, type: string, created_at: datetime, updated_at: datetime, slug: string)
2009-11-21 14:45:43,815 [main] INFO org.monkey.pyrot.client.NzbServer - Working directory: /Library/PreferencePanes/Pyrot.prefPane/Contents/Resources/pyrot
2009-11-21 14:45:45,191 [main] DEBUG org.monkey.pyrot.client.processors.ParRepair - No path specified, executing "which par2" to determine the full path
2009-11-21 14:45:45,192 [main] INFO org.monkey.pyrot.client.processors.Unrar - What is the final command? /Library/PreferencePanes/Pyrot.prefPane/Contents/Resources/pyrot/bin/unrar
2009-11-21 14:45:45,193 [main] DEBUG org.monkey.pyrot.client.processors.ParRepair - No path specified, executing "which par2" to determine the full path
2009-11-21 14:45:45,193 [main] INFO org.monkey.pyrot.client.processors.Unrar - What is the final command? /Library/PreferencePanes/Pyrot.prefPane/Contents/Resources/pyrot/bin/unrar
2009-11-21 14:45:45,193 [main] DEBUG org.monkey.pyrot.client.NzbServer - Loaded the config file
2009-11-21 14:45:45,437 [main] INFO org.monkey.pyrot.client.NzbServer - Looking for InternetGatewayD
PLUGIN_PATH = "vendor/plugins/community_engine/"
PLUGIN_TESTS_TO_IGNORE = ["functional/skills_controller_test.rb",
"functional/posts_controller_test.rb"].collect { |t| "#{PLUGIN_PATH}test/#{t}"}
Autotest.add_hook :initialize do |at|
at.clear_exceptions
at.clear_mappings
%w{.git .svn stories tmtags Rakefile Capfile README spec/spec.opts spec/rcov.opts vendor/gems autotest svn-commit .DS_Store }.each do |exception|
at.add_exception(exception)
scope(:module => :admin, :as => :admin) do
namespace :content do
resources :pages do
resources :input_definitions
end
end
end
admin_content_page_input_definitions GET /:domain/content/pages/:page_id/input_definitions(.:format) {:action=>"index", :controller=>"admin/content/input_definitions"}
@jeremy6d
jeremy6d / mongoid_add_to_references_many_relation_test.rb
Created June 23, 2011 13:53
Mongoid references_many adding problem
require 'mongoid'
require 'test/unit'
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("adding_to_references_many_test")
end
class Node
include Mongoid::Document
@jeremy6d
jeremy6d / gist:8343731
Created January 9, 2014 22:59
Letter concerning irregularities in the data backing the Mayor's Shockoe Bottom redevelopment plans
Dear Sir or Madam,
I have continued to read about the project and I have found some problems in the most recent study by Davenport.
Please note their first assumption on page 3 of the report. It reads as follows: "All Non-Ballpark (i.e. Retail, Residential, Hotel, Office, Parking, etc.) improvements will be privately financed by the Developer." Underneath this, they repeat, underline, and emphasize their first assumption: "No allowances have been made with respect to development incentives."
Their second assumption contains the first mistake made in the compilation of their report. They appear to have misunderstood the 2009 ERA report. Davenport's study states:
"In conducting our analysis, Davenport has extrapolated the following assumptions from the original 2009 Era Report:
@jeremy6d
jeremy6d / gist:8344900
Created January 10, 2014 00:41
Kambourian Map showing slave graves, used for Shockoe Ballpark planning, is being misused, says map author!
FROM Elizabeth Dudley Cann Kambourian:
Regarding the Stadium Controversy: It has been brought to my attention that the Slave Trail Commission, and Mayor Jones are citing the so-called "Kambourian Map" as their "evidence" that there are no pertinent slave trading sites within the proposed footprint of the Stadium. Let me make it perfectly clear: the "Kambourian Map" is one I showed to the Slave Trail Commission in the fall of 2000, as an "idea" of what might be located in Shockoe Bottom. Ralph White asked if he could make a copy of it. I agreed based on his assurance that it would not be shared or used. I made it clear that it was a rough preliminary sketch and was not by any means verified information.
In the interim. My map has been used in Slave Trail Publications and god knows what other so called documentation. I have pointed out, many times to various members that the map was not correct, complete or accurate. I refused to allow my map to be used when asked by Mr. White and others.
Assorted mistakes
@jeremy6d
jeremy6d / gist:9510253
Created March 12, 2014 16:14
Defining a method on a model attribute within its accessor
# note that 'tags' is an array attribute in Mongoid
def tags
read_attribute(name).tap do |array|
def array.to_s
join(", ")
end
end
end