+-----------------------+------------------+-----------------+
| | eager load paths | auto load paths |
+-----------------------+------------------+-----------------+
| Rails 3 (development) | auto loaded | auto loaded |
| Rails 4 (development) | auto loaded | auto loaded |
| Rails 3 (production) | eager loaded | auto loaded |
| Rails 4 (production) | eager loaded | eager loaded |
+-----------------------+------------------+-----------------+
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
[Desktop Entry] | |
Name=Aptana Studio 3 | |
Comment=Integrated development environment (IDE) for building Ajax web applications. | |
Exec=/home/biske/Aptana_Studio_3/AptanaStudio3 -applciation | |
Icon=/home/biske/Aptana_Studio_3/icon.xpm | |
Terminal=false | |
Type=Application | |
StartupNotify=true | |
Categories=Development;RevisionControl; | |
X-GNOME-FullName=Aptana Studio 3 |
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 "capybara" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
puts sess.find('#id1').text | |
__END__ |
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
class ControllerTestCase < ActionController::TestCase | |
include Devise::TestHelpers | |
include Warden::Test::Helpers | |
def setup | |
Warden.test_mode! | |
self.do_setup | |
end |
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
class User < ActiveRecord::Base | |
alias :devise_valid_password? :valid_password? | |
def valid_password?(password) | |
begin | |
devise_valid_password?(password) | |
rescue BCrypt::Errors::InvalidHash | |
return false unless Digest::SHA1.hexdigest(password) == encrypted_password | |
logger.info "User #{email} is using the old password hashing method, updating attribute." | |
self.password = password |
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
http://blog.mattwynne.net/2012/04/09/hexagonal-rails-introduction/ | |
http://darwinweb.net/articles/modular-development-on-rails |
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
class CompressedRequests | |
def initialize(app) | |
@app = app | |
end | |
def method_handled?(env) | |
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/) | |
end | |
def encoding_handled?(env) |
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
/* | |
Show a progress element for any form submission via POST. | |
Prevent the form element from being submitted twice. | |
*/ | |
(function (win, doc) { | |
'use strict'; | |
if (!doc.querySelectorAll || !win.addEventListener) { | |
// doesn't cut the mustard. | |
return; | |
} |
It's a common misconception that [William Shakespeare][1] and [Miguel de Cervantes][2] died on the same day in history - so much so that UNESCO named April 23 as [World Book Day because of this fact][3]. However because England hadn't yet adopted [Gregorian Calendar Reform][4] (and wouldn't until [1752][5]) their deaths are actually 10 days apart. Since Ruby's Time
class implements a [proleptic Gregorian calendar][6] and has no concept of calendar reform then there's no way to express this. This is where DateTime
steps in:
>> shakespeare = DateTime.iso8601('1616-04-23', Date::ENGLAND)
=> Tue, 23 Apr 1616 00:00:00 +0000
>> cervantes = DateTime.iso8601('1616-04-23', Date::ITALY)
=> Sat, 23 Apr 1616 00:00:00 +0000
Apple MacBook Pro M1, 32 GB, Ventura 13.2
Documentation based on comments in this Github Elasticsearch issue.
Install Homebrew
OlderNewer