Skip to content

Instantly share code, notes, and snippets.

View paulca's full-sized avatar

Paul Campbell paulca

View GitHub Profile
Paul-Campbells-MacBook-Air:~ paul$ whois úll.ie
% Dot IE domain names must:
-be less than 66 characters in length, including the '.ie' characters
-not start with a hyphen '-'
-not have a label ending in a hyphen before the '.ie' e.g. 'xyz-.ie'
@paulca
paulca / dsl.coffee
Created November 25, 2011 14:55 — forked from jed/dsl.coffee
example dsl
html lang: en,
head {},
title "Hello, world."
meta charset: "utf8"
body {},
div id: "container"
"Welcome to my website."
@paulca
paulca / gist:1367165
Created November 15, 2011 14:10
Paul
...................................................................................................................... . ..........
................................ ...........................................................................................
..............................................................................................................................
...................................... ................................... ............................................... .
...................................... ................................. ............................................ .
@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',
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 %>