save_and_open_page
have_button(locator)
StandardError | |
SQLite3::Exception | |
SQLite3::MemoryException | |
SQLite3::LockedException | |
SQLite3::BusyException | |
SQLite3::AbortException | |
SQLite3::PermissionException | |
SQLite3::InternalException | |
SQLite3::SQLException | |
SQLite3::NotADatabaseException |
module UiHelper | |
def lorem(paras) | |
paras = around(paras) if paras.is_a?(Range) | |
Faker::Lorem.paragraphs(paras).map{|p| "<p>#{p}</p>"}.join.html_safe | |
end | |
def lorem_words(num) | |
num = around(num) if num.is_a?(Range) | |
Faker::Lorem.words(num).join(' ').html_safe |
require 'rubygems' | |
require 'benchmark' | |
require 'haml' | |
haml_template = File.read('template.haml') | |
erb_template = File.read('template.erb') | |
Benchmark.bm do |x| | |
x.report('haml:') { 1000.times{ Haml::Engine.new(haml_template).render } } | |
x.report('erb:') { 1000.times{ ERB.new(erb_template, nil, '-').src } } |
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl libssl-dev \ | |
libreadline5 libreadline5-dev \ | |
zlib1g zlib1g-dev \ | |
libmysqlclient-dev \ | |
libcurl4-openssl-dev \ | |
libxslt-dev libxml2-dev |
upstream app { | |
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.app.com; | |
rewrite ^/(.*) http://app.com/$1 permanent; | |
} | |
server { |
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the | |
filesystem will be different but this guide will get you working with it | |
while we wait for all that to finalize. | |
Ignore the number prefixes on each file. This is just to ensure proper order in the Gist. | |
It's based on eric1234 gist https://gist.github.com/911003. ijust made it 3.1 compliant in terms of convention |
UPDATE: Please see some of the forks for an updated version of this guide. I | |
myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if | |
you want to stay on stable there are other folks who are keeping this guide | |
relevant despite the changes constantly occurring on Sprockets 2. The comments | |
on this gist will lead you to the right forks. :) | |
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the |
module ActionController | |
class Metal | |
attr_internal :cached_content_for | |
end | |
module Caching | |
module Actions | |
def _save_fragment(name, options) | |
return unless caching_allowed? |
/* | |
* Full example here: http://jsfiddle.net/jboesch26/3SKsL/1/ | |
*/ | |
$.fn.outerHTML = function(){ | |
// IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning | |
return (!this.length) ? this : (this[0].outerHTML || ( | |
function(el){ | |
var div = document.createElement('div'); |