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
Git revision: 9b395bad80da30f0101e5df91cc9d18aeac2b3c1 | |
$ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.0.rb DB=postgres bundle exec rake bench | |
------------------------------------------------------------------------ | |
Using ruby 2.0.0 AR 4.0.0 with postgres | |
Rehearsal ---------------------------------------------------------------------------------- | |
find (without FriendlyId) 0.340000 0.030000 0.370000 ( 0.473857) | |
find (in-table slug) 0.990000 0.040000 1.030000 ( 1.285145) | |
find (in-table slug; included FinderMethods) 0.420000 0.020000 0.440000 ( 0.663232) | |
find (external slug) 1.630000 0.050000 1.680000 ( 2.194663) |
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
# config/initializers/clear_logs.rb | |
# This snippet simply clears your logs when they are too large. | |
# Large logs mean looooong search in TextMate. You know it :) | |
# Every time you run rails server or rails console it checks log sizes | |
# and clears the logs for you if necessary. | |
if Rails.env.development? | |
MAX_LOG_SIZE = 2.megabytes | |
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 'rubygems' | |
require 'httparty' | |
require 'curb' | |
require 'net/http' | |
require 'benchmark' | |
include Benchmark | |
RUNS = 1000 | |
url = 'http://localhost:4567/' |
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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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/sh | |
# on ubuntu: need some utils & dev libs | |
sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev | |
# compile nginx | |
cd /tmp | |
curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz | |
cd nginx* | |
./configure --with-http_ssl_module --with-http_dav_module \ |
NewerOlder