This file contains hidden or 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
2012-03-05T20:32:02+00:00 heroku[web.1]: Stopping process with SIGKILL | |
2012-03-05T20:32:04+00:00 heroku[web.1]: Process exited with status 137 | |
2012-03-05T20:32:06+00:00 app[web.1]: [2012-03-05 20:32:06] INFO WEBrick 1.3.1 | |
2012-03-05T20:32:06+00:00 app[web.1]: [2012-03-05 20:32:06] INFO ruby 1.9.2 (2011-07-09) [x86_64-linux] | |
2012-03-05T20:32:06+00:00 app[web.1]: [2012-03-05 20:32:06] INFO WEBrick::HTTPServer#start: pid=1 port=56080 | |
2012-03-05T20:32:07+00:00 heroku[web.1]: State changed from starting to up | |
2012-03-05T20:34:01+00:00 heroku[run.1]: State changed from created to starting | |
2012-03-05T20:34:07+00:00 app[run.1]: Awaiting client | |
2012-03-05T20:34:07+00:00 app[run.1]: Starting process with command `bundle exec rake db:migrate` | |
2012-03-05T20:34:08+00:00 heroku[run.1]: State changed from starting to up |
This file contains hidden or 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
def setup_environment | |
# Configure Rails Environment | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../dummy/config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'capybara/rspec' | |
require 'factory_girl_rails' |
This file contains hidden or 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 rr { | |
cwd=`pwd` | |
not_found=true | |
while [[ "`pwd`" != "/" && $not_found == true ]]; do | |
if [[ ( -f '.rails_root' ) || ( -d 'app' && -d 'config' ) ]]; then | |
not_found=false | |
cd `pwd` | |
continue | |
fi | |
cd .. |
This file contains hidden or 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 RegistrationController < ApplicationController | |
before_filter :find_user | |
def create | |
if @user.save | |
add_reminders_to @user | |
else | |
render :new, :errors => "Something weird" | |
end | |
end |
This file contains hidden or 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
powder/ruby/1.9.1/bin/erubis | |
powder/ruby/1.9.1/bin/haml | |
powder/ruby/1.9.1/bin/html2haml | |
powder/ruby/1.9.1/bin/rackup | |
powder/ruby/1.9.1/bin/rails | |
powder/ruby/1.9.1/bin/rake | |
powder/ruby/1.9.1/bin/rake2thor | |
powder/ruby/1.9.1/bin/rdoc | |
powder/ruby/1.9.1/bin/ri | |
powder/ruby/1.9.1/bin/sass |
This file contains hidden or 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
# cat /var/log/apache2/error.log | tail -n 2 | |
[Sun May 17 02:46:11 2009] [error] [client xxx.xxx.xxx.xxx] | |
Symbolic link not allowed or link target | |
not accessible: /var/www/wedding | |
[Sun May 17 02:51:18 2009] [error] [client xxx.xxx.xxx.xxx] | |
Symbolic link not allowed or link target | |
not accessible: /var/www/chat |
This file contains hidden or 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 OfflineMessages < IRCClient | |
def initialize | |
add_hook(:join) { |m| send_message( m[:user] ) } | |
add_hook(:command) { |m| route m[:target], m[:user], m[:command] } | |
end | |
def route(target, user, command) | |
if /\Atell/i.match user command | |
save_message(user, command) |
This file contains hidden or 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
#retrive a number between 1 and another value - varUpper | |
# R: In Ruby, we strive for legibility. varUpper is an okay variable name, but an even better one would be upper_limit (var is implied by the fact it's a var, and Upper isn't clear as to what it refers). | |
upper_limit = 100 | |
# R: This is one way to do a string, with single quotes. There are also a couple of alternatives, but the primary one is this: | |
# Double quotes let you put variables in a string in between #{} -- this will also automatically call .to_s. | |
puts "Welcome to Keith's Prime Number Checker. Please enter an integer between one and #{upper_limit}" | |
# R: We'll name this something more verbose, too: |
This file contains hidden or 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
# Globalizing an Engine: | |
# app/views/<model>.rb | |
#- add "require 'globalize3'" | |
#- In class definition: | |
#- Remove 'is_seo_meta if self.table_exists?' | |
#- Add following: | |
This file contains hidden or 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
== AddTranslationTableToBlog: migrating ====================================== | |
rake aborted! | |
An error has occurred, this and all later migrations canceled: | |
Bad field type for field :custom_title (nil), should be :string or :text | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:101:in `block in validate_translated_fields' | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:99:in `each' | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:99:in `validate_translated_fields' | |
/Users/rob/.rvm/gems/ruby-1.9.2-p290/gems/globalize3-0.1.0/lib/globalize/active_record/migration.rb:29:in `create_translation_table!' |