Skip to content

Instantly share code, notes, and snippets.

View paulca's full-sized avatar

Paul Campbell paulca

View GitHub Profile
No attribute named `private` exists for table `users`
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/predicate_builder.rb:24:in `build_from_hash'
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/query_methods.rb:216:in `map'
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/predicate_builder.rb:9:in `each'
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/predicate_builder.rb:9:in `map'
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/predicate_builder.rb:9:in `build_from_hash'
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/query_methods.rb:216:in `build_where'
/Users/paul/.rvm/gems/ree-1.8.7-2010.02@roadio/gems/activerecord-3.0.0.beta4/lib/active_record/relation/query_methods.rb:42:

Here's what I'm thinking. A single command for creating "projects" ... a project being your app, or your gem or your library or whatever.

project new APPNAME
#=> creates a new folder with a .rvmrc and its own gemset

project init gem
#=> creates a new Gemfile

project load

#=> essentially just runs "bundle install"

Subscription = {
choose_plan: function(){
console.log('boom')
},
initialize: function(){
$('li[data-behavior=choose-plan]').click(this.choose_plan)
}
}
require 'webrat'
Webrat.configure do |config|
config.mode = :mechanize
end
class MechanizeWorld < Webrat::MechanizeAdapter
include Webrat::Matchers
include Webrat::Methods
# no idea why we need this but without it response_code is not always recognized
def simple_format(string)
super(h(string)).html_safe!
end
def t(*args)
super.html_safe!
end
Template = {
// <%- f = form_for setup_peer_test(@peer_test) do |f| -%>
<%- f.fields_for(:steps) do |step_form| step = step_form.object -%>
<%- if step.step_type == 'action' -%>
'add_action': "<%= escape_javascript(render(:partial => 'my/peer_tests/action', :locals => {:step_form => step_form})) %>",
<%- else -%>
'add_question': "<%= escape_javascript(render(:partial => 'my/peer_tests/question', :locals => {:step_form => step_form})) %>",
<%- end -%>
<%- end -%>
//<%- end %>
en:
# general
save: Save
or: or
cancel: Cancel
# site
welcome_to_the_site: Welcome to the Site
not_namespaced: Not Namespaced
-- Settings --
set projects_root to "~/Sites" -- where you keep your projects
set presets to {"project/projectname"} -- sub directories to “project_root'”
set visor_enabled to false -- if you use Visor “http://docs.blacktree.com/visor/visor”, set this to true
set rails_server_command to "tail -f log/development.log" -- My `ss` bash function will use the next available port (http://pastie.textmate.org/221395) so I can run multiple rails projects at once. if you don't have a `ss` alias/script, just use `./script/server` for mongrel/thin etc. If you're on mod_rails, just `tail -f log/development.log`
-- Run it
global rails_dir, min_window_count, presets, projects_root, visor_enabled, rails_server_command
main()
# template.rb
# USAGE: rails -m http://gist.github.com/gists/115163.txt PROJECT_NAME
run "rm public/index.html"
plugin 'thinking_sphinx', :git => 'git://github.com/freelancing-god/thinking-sphinx.git'
plugin 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git'
plugin 'factory_girl', :git => 'git://github.com/thoughtbot/factory_girl.git'
plugin 'paperclip', :git => 'git://github.com/thoughtbot/paperclip.git'
plugin 'project_search', :git => 'git://github.com/37signals/project_search.git'
plugin 'hubahuba', :git => 'git://github.com/paulca/hubahuba.git'
require 'twitter'
# your Twitter credentials
twitter_username = ''
twitter_password = ''
# the user you'd like to check friends / followers for. Set to nil, or omit for your own list
search_user = ''
client = Twitter::Base.new(twitter_username,twitter_password)