This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails_heroku_mongohq_template.rb | |
# | |
# fork of Kyle Banker's Rails MongoMapper Template (http://gist.github.com/219223) | |
# and modified to work with heroku's mongohq addon. | |
# | |
# To use: | |
# rails project_name -m http://gist.github.com/403483.txt | |
# (preface with 'sudo' if you think you might need some gems) | |
# remove unneeded defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: &global_settings | |
database: textual_development | |
host: 127.0.0.1 | |
port: 27017 | |
test: | |
database: textual_test | |
<<: *global_settings | |
production: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# To uninstall all gems | |
GEMS=`gem list --no-versions` | |
for x in $GEMS ; do gem uninstall $x; done | |
# In a future revision it would be | |
# nice to prevent all the prompts but it's | |
# still faster than the alternative as it is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using the default profile... | |
no such file to load -- action_controller/test_process (LoadError) | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/active_support/dependencies.rb:219:in `require' | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/active_support/dependencies.rb:219:in `require' | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/active_support/dependencies.rb:207:in `load_dependency' | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/active_support/dependencies.rb:219:in `require' | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/rspec-rails-1.3.2/lib/spec/rails.rb:8 | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/active_support/dependencies.rb:219:in `require' | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/active_support/dependencies.rb:219:in `require' | |
/Users/don/.rvm/gems/ruby-1.8.7-p299@lemmego/gems/activesupport-3.0.0.rc/lib/activ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rspec' | |
class MaterialSelector | |
def select(model, material) | |
model.selection.clear | |
model.entities.each do |entity| | |
select_with entity, material do |matching_entity| | |
model.selection.add matching_entity | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event < ActiveRecord::Base | |
has_many :event_users | |
has_many :producers, :through => :event_users, :source => :user | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head><title><%= yield(:title) %></title></head> | |
<body> | |
<h1><%= yield(:title) %></h1> | |
<%= yield %> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/views/talks/_form.html.erb | |
<%= form_for([@event, @talk]) do |f| %> | |
<% if @talk.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@talk.errors.count, "error") %> prohibited this talk from being saved:</h2> | |
<ul> | |
<% @talk.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$.widget("ui.mywidget", { | |
options: { | |
autoOpen: true | |
}, | |
_create: function(){ | |
// by default, consider this thing closed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
$.Widget.prototype = { | |
... | |
destroy: function() { | |
this.element | |
.unbind( "." + this.widgetName ) | |
.removeData( this.widgetName ); | |
this.widget() | |
.unbind( "." + this.widgetName ) | |
.removeAttr( "aria-disabled" ) |
OlderNewer