Skip to content

Instantly share code, notes, and snippets.

View robyurkowski's full-sized avatar

Rob Yurkowski robyurkowski

View GitHub Profile
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
@robyurkowski
robyurkowski / spec_helper.rb
Created February 23, 2012 19:59
Spec helper for @pivotal-liquidit
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'
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 ..
class RegistrationController < ApplicationController
before_filter :find_user
def create
if @user.save
add_reminders_to @user
else
render :new, :errors => "Something weird"
end
end
@robyurkowski
robyurkowski / filelist.txt
Created December 14, 2011 20:18
Weird unpacking issue
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
@robyurkowski
robyurkowski / apache2-logs.log
Created November 13, 2011 09:10
apache2 logs
# 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
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)
@robyurkowski
robyurkowski / PrimeNoV2.rb
Created September 29, 2011 19:17 — forked from anonymous/PrimeNoV2
Prime number checker
#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:
@robyurkowski
robyurkowski / globalizing.rb
Created September 28, 2011 21:10
Globalizing an Engine -- rough notes
# Globalizing an Engine:
# app/views/<model>.rb
#- add "require 'globalize3'"
#- In class definition:
#- Remove 'is_seo_meta if self.table_exists?'
#- Add following:
@robyurkowski
robyurkowski / Error Result
Created September 1, 2011 05:19
Funky Times with Globalize3
== 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!'