brew install logrotate
export PATH=${PATH}:/usr/local/sbin
logrotate -?
http { | |
upstream app_server { | |
# for UNIX domain socket setups: | |
server unix:/tmp/app.sock fail_timeout=0; | |
# for TCP setups, point these to your backend servers | |
# server 127.0.0.1:8081 fail_timeout=0; | |
# server 127.0.0.1:8082 fail_timeout=0; | |
# server 127.0.0.1:8083 fail_timeout=0; | |
} |
require 'minitest/autorun' | |
### | |
# Test to demonstrate TCO in Ruby. Tested in 1.9.2+ | |
class TestTCO < MiniTest::Unit::TestCase | |
code = <<-eocode | |
class Facts | |
def fact_helper(n, res) | |
if n == 1 | |
res |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
# http://stackoverflow.com/questions/2458632/how-to-test-a-confirm-dialog-with-cucumber | |
page.evaluate_script('window.confirm = function() { return true; }') | |
page.click('Remove') |
# Place in config/initializers/ | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 | |
call_without_quiet_assets(env).tap do | |
Rails.logger.level = previous_level | |
end |
describe "Shopping Cart Requests" do | |
let!(:user) { Fabricate(:user) } | |
before(:each) do | |
login_user_post("admin", "admin") | |
end | |
context "when I visit the shopping cart" do | |
it " show the logged in users' cart items " do | |
#Test stuff |
This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.
Huge thanks to funny-falcon for the performance patches.
/* See: http://nicolasgallagher.com/micro-clearfix-hack/ */ | |
/* For modern browsers */ | |
.cf:before, | |
.cf:after { | |
content:""; | |
display:table; | |
// Firefox <= 3.5 will need the following instead: | |
// content:"."; |
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |