Skip to content

Instantly share code, notes, and snippets.

***lib/tasks/metrics***
begin
require 'metric_fu'
MetricFu::Configuration.run do |config|
config.metrics = [:flog]
config.flog = { :dirs_to_flog => ['app'] }
end
rescue LoadError
end
This is a project for tracking myself. The things I should do, don't do, wish I did, etc.
"Bugs" are things that I don't like that I aim to change. They can be given by anyone at "failin.gs" email, or submitted in person. (nailbiting and the like)
"Chores" are things that I need to do that don't add business value directly. (unimportant meetings, cleaning the gutters)
"Features" are things that do add business value, ie. things that I enjoy, improve my skills, and benefit my relationships with others.
There are two complications to using this project management system for this that I can predict now:
Interesting...
~ $ irb
irb(main):001:0> test
ArgumentError: wrong number of arguments
from (irb):1:in `test'
from (irb):1
For some reason, neither of the following get the behavior I expected:
FileUtils.cp_r 'src/*', 'dest'
`cp -r src/* dest`
I need a period, not an asterisk.
From the docs:
FileUtils.cp_r 'src/.', 'dest'
# cp_r('src', 'dest') makes src/dest, but this doesn't.
matching last comma in a string with negative lookahead
,(?!.*,)
From total DNS control on godaddy.
3 A Records
Host- @
IPs- http://docs.heroku.com/custom-domains
CName
Host- www
Points to- proxy.heroku.com
WTF
Spec::Mocks::MockExpectationError in 'SchemesController when I successfully POST 'create should create the scheme'
<TweetScheme(id: integer, user_id: integer, title: string, description: string, type: string, random_interval: boolean, frequency: integer, tweet_prompt: string, tweet_prompt_relationship: string, prompt: string, target: string, target_relationship: string, created_at: datetime, updated_at: datetime) (class)> received :new with unexpected arguments
expected: ([{"title"=>"scheme", "type"=>"TweetScheme", "description"=>"this is a scheme"}])
got: ([{"title"=>"scheme", "type"=>"TweetScheme", "description"=>"this is a scheme"}])
Remember to set the parent model with all the attributes. There is no table for the sub models.
Ugh part one. From
http://code.alexreisner.com/articles/single-table-inheritance-in-rails.html
Overwrite the child models' model_name method:
def self.model_name
name = "vehical"
name.instance_eval do
def plural; pluralize; end
request.request_uri
controller.controller_name
controller.action_name
When I can't figure it out, for too long, it's usually one of these things.
Forget to include a file
Forget to load a library
Forget to call the executed code
Compare with "=" instead of "=="
Misspell variable names
Misspell method names
Forget to migrate
Call the wrong database