-
Speed up development by only reloading classes if dependencies files changed. This can be turned off by setting
config.reload_classes_only_on_change
to false. José Valim -
New applications get a flag
config.active_record.auto_explain_threshold_in_seconds
in the environments configuration files. With a value of 0.5 in development.rb, and commented out in production.rb. No mention in test.rb. fxn -
Add DebugExceptions middleware which contains features extracted from ShowExceptions middleware José Valim
-
Display mounted engine's routes in
rake routes
Piotr Sarnacki
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
# you generally only need one nginx worker unless you're serving | |
# large amounts of static files which require blocking disk reads | |
worker_processes 1; | |
# # drop privileges, root is needed on most systems for binding to port 80 | |
# # (or anything < 1024). Capability-based security may be available for | |
# # your system and worth checking out so you won't need to be root to | |
# # start nginx to bind on 80 | |
user nobody nogroup; # for systems with a "nogroup" |
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
upstream app_server { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
# for UNIX domain socket setups: | |
server unix:/tmp/.sock fail_timeout=0; | |
# for TCP setups, point these to your backend servers | |
# server 192.168.0.7:8080 fail_timeout=0; |
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
# Sample verbose configuration file for Unicorn (not Rack) | |
# | |
# This configuration file documents many features of Unicorn | |
# that may not be needed for some applications. See | |
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb | |
# for a much simpler configuration file. | |
# | |
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete | |
# documentation. |
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
set :application, "hermes" | |
set :repository, "git@your_repository:hermes.git" | |
set :user, 'root' | |
set :use_sudo, false | |
set :deploy_via, :remote_cache | |
set :scm, :git | |
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` | |
role :web, "xxx.com" # Your HTTP server, Apache/etc |
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 Rails::Boot | |
def run | |
load_initializer | |
Rails::Initializer.class_eval do | |
def load_gems | |
@bundler_loaded ||= Bundler.require :default, Rails.env | |
end | |
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
begin | |
require "rubygems" | |
require "bundler" | |
rescue LoadError | |
raise "Could not load the bundler gem. Install it with `gem install bundler`." | |
end | |
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24") | |
raise RuntimeError, "Your bundler version is too old for Rails 2.3." + | |
"Run `gem install bundler` to upgrade." |
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
#!/usr/bin/env ruby | |
# This script is a backup tool for mongodb. | |
# | |
# The main purpose is to dump files from gridfs to filesystem, | |
# to take advantage of backup solutions based on tools like | |
# rsync. | |
# Developed against mongo 1.6.0 |
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 'mongo' | |
class GridfsController < ActionController::Metal | |
def serve | |
env["PATH_INFO"].match(/\/attach\/([\da-zA-Z]+)\//) | |
begin | |
grid = Mongo::Grid.new(Mongoid.database).get(BSON::ObjectId($1)) | |
self.headers["Content-Length"] = grid.file_length.to_s | |
self.content_type = grid.content_type | |
self.response_body = grid.read |
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
.box-shadow{ | |
filter: progid:DXImageTransform.Microsoft.Shadow(color='#969696', Direction=135, Strength=5);/*for ie6,7,8*/ | |
background-color: #eee; | |
-webkit-box-shadow:2px 2px 5px #969696;/*webkit*/ | |
box-shadow:2px 2px 5px #969696;/*opera或ie9*/ |
OlderNewer