Skip to content

Instantly share code, notes, and snippets.

View stevencwarren's full-sized avatar

Steven Warren stevencwarren

View GitHub Profile
def weight=(weight)
write_attribute(:weight, weight.to_d.ceil.to_i)
end
require 'spec_helper.rb'
describe ArticlesController do
describe 'GET index' do
before(:each) do
10.times do |i|
Factory(:article, :title => "Article #{i}")
end
@unpublished_article = Factory(:article, :title => "Unpublished Article", :published_at => Date.tomorrow)
export PATH=/usr/local/bin:$PATH
#slider-description1.animate-in,
#slider-description2.animate-in,
#slider-description3.animate-in,
#slider-description4.animate-in {
opacity: 1;
filter: alpha(opacity=100);
top: 300px;
-webkit-transition: 1s;
-moz-transition: 1s;
-ms-transition: 1s;
002RevzAdIT
Parameters: {"order_number"=>"002RevzAdIT", "guid"=>"002RevzAdIT-0881062468", "ip_address"=>"70.88.5.237", "shipping_amount"=>"0.00", "shipping_amount_usd"=>"0.00", "tax_amount"=>"0.92", "tax_amount_usd"=>"0.92", "subtotal"=>"9.95", "subtotal_usd"=>"9.95", "currency_num"=>"840", "email_address"=>"[email protected]", "billing"=>{"first_name"=>"[FILTERED]", "last_name"=>"[FILTERED]", "middle_initial"=>false, "address"=>"1234 Something Street", "address2"=>"", "city"=>"Nashville", "province"=>"TN", "postal_code"=>"37216", "country_code"=>"US", "phone"=>"5555555555"}, "shipping"=>{"first_name"=>"[FILTERED]", "last_name"=>"[FILTERED]", "middle_initial"=>"", "address"=>"1234 Something Street", "address2"=>"", "city"=>"Nashville", "province"=>"TN", "postal_code"=>"37216", "country_code"=>"US", "phone"=>"5555555555"}, "commodities"=>[{"name"=>"[FILTERED]", "sku"=>"INA118101", "description"=>"<ul>\v<li>Set of 2 perfect-bound, blank journals</li>\v<li>4 1/4\" x 6 1/2\" x 3/4\"</li>\v<li>150 lined
config.before :suite do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
# Request specs cannot use a transaction because Capybara runs in a
# separate thread with a different database connection.
config.before type: :request do
DatabaseCleaner.strategy = :truncation
end
2012-08-05 00:16:20 [INFO] comike011 [/76.22.251.80:35696] lost connection
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.FilterInputStream.read(FilterInputStream.java:116)
at akm.a(Unknown Source)
at akm.read(Unknown Source)
at java.io.FilterInputStream.read(FilterInputStream.java:66)
at db.a(SourceFile:169)
at bb.i(SourceFile:240)
def current_user_session(force_reload=false)
return @current_user_session unless force_reload || !defined?(@current_user_session)
@current_user_session = UserSession.find
end
def current_user(force_reload=false)
return @current_user unless force_reload || !defined?(@current_user)
@current_user = current_user_session(force_reload) && current_user_session.user
end
PS1="\n\[$YELLOW\]\@ \[$GREEN\]\u\[$NO_COLOR\]@\[$GREEN\]\h \[$YELLOW\][\$(rvm-prompt i v)]\[$NO_COLOR\]:\w \[$CYAN\]\$(vcprompt)\[$NO_COLOR\] \n→ "
def export_to_js(name, value, opts={})
s = <<RUBY
<script type="text/javascript">
DATA['#{name}'] = #{value.to_json(opts).html_safe};
</script>
RUBY
s.html_safe
end
put this in the application helper.