- Documented replication topology
- Documented network topology
- Documented interface topology - including users, passwords, connection estimates, load balancers, connection proxies
- Documented procedure, schedule for failover and testing
- Documented procedure, schedule for disaster recovery and testing
| module DefaultValues | |
| def has_default_values(default_values = {}) | |
| class_attribute :default_values | |
| self.default_values = default_values | |
| after_initialize :assign_default_values | |
| include InstanceMethods |
One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.
Most workflows make the following compromises:
-
Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the
secureflag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection. -
Use production SSL certificates locally. This is annoying
| # An abstract base class used to create simple serializers | |
| # for ActiveRecord objects | |
| class BaseSerializer | |
| include Rails.application.routes.url_helpers | |
| attr_reader :serialized_object | |
| def initialize(serialized_object) | |
| @serialized_object = serialized_object | |
| end |
| if [ -f "$rvm_path/scripts/rvm" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| if [ -f ".rvmrc" ]; then | |
| source ".rvmrc" | |
| fi | |
| if [ -f ".ruby-version" ]; then | |
| rvm use `cat .ruby-version` | |
| fi |
| <figure class="quote"> | |
| <blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote> | |
| </figure> |
A clean workaround for running capybara tests on Rails with assets pipeline enabled.
Original: teamcapybara/capybara#500 (comment)
| @import compass | |
| $icons: sprite-map("icons/*.png") | |
| $icons-hd: sprite-map("icons-hd/*.png") | |
| i | |
| background: $icons | |
| display: inline-block | |
| @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) | |
| background: $icons-hd |