Skip to content

Instantly share code, notes, and snippets.

View paulca's full-sized avatar

Paul Campbell paulca

View GitHub Profile
-- 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()
en:
# general
save: Save
or: or
cancel: Cancel
# site
welcome_to_the_site: Welcome to the Site
not_namespaced: Not Namespaced
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 %>
def simple_format(string)
super(h(string)).html_safe!
end
def t(*args)
super.html_safe!
end
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
Subscription = {
choose_plan: function(){
console.log('boom')
},
initialize: function(){
$('li[data-behavior=choose-plan]').click(this.choose_plan)
}
}

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"

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:
@paulca
paulca / eason_book_spec_after.rb
Created January 15, 2011 12:56
refactoring using let, subject and its
require 'spec_helper'
describe EasonBook do
describe ".load!" do
let(:house_at_riverton_item) { Item.find_by_barcode(9780330448444) }
let(:house_at_riverton) { EasonBook.find(9780330448444) }
before(:each) do
# set a category mapping
CategoryMapping.create!({:system_name => 'eason',
@paulca
paulca / gist:1367165
Created November 15, 2011 14:10
Paul
...................................................................................................................... . ..........
................................ ...........................................................................................
..............................................................................................................................
...................................... ................................... ............................................... .
...................................... ................................. ............................................ .