echo 'export NEWRELIC_DISPATCHER=pow' >> ~/.powconfig
echo 'export POW_WORKERS=1' >> ~/.powconfig
Explanation:
http://andre.arko.net/2011/11/12/use-newrelic-rpm-developer-mode-with-pow/
echo 'export NEWRELIC_DISPATCHER=pow' >> ~/.powconfig
echo 'export POW_WORKERS=1' >> ~/.powconfig
Explanation:
http://andre.arko.net/2011/11/12/use-newrelic-rpm-developer-mode-with-pow/
Updated for Rails 4.0.0+
Set up the bower
gem.
Follow the Bower instructions and list your dependencies in your bower.json
, e.g.
// bower.json
{
units = types.reject { |type, dir| type == 'features' } | |
namespace :spec do | |
desc "Run 'unit' specs: #{units.keys.to_sentence}" | |
RSpec::Core::RakeTask.new(:units) do |t| | |
t.pattern = units.map { |type, dir| "./#{dir}/**/*_spec.rb" } | |
end | |
end | |
default_task = Rake::Task['default'] |
Every couple of weeks, I hear someone complaining about some difficulties with Bundler. Yesterday, it happened twice. But somehow I just never have those difficulties. I'm not saying Bundler is perfect; certainly in its early days it wasn't even close. But for the past two years it's been incredibly solid and trouble-free for me, and I think a large part of the reason is the way I use it. Bundler arguably does too much, and just as with Git, a big part of it is knowing what not to do, and configuring things to avoid the trouble spots.
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
Sinatra 1.4.4 | |
Rails 4.0.1 | |
Rails-API 0.1.0 | |
Rails-API disabled Mailer and Sockets | |
Each app connected to a MySQL database via ActiveRecord with an empty Accounts table; each app's root path responded with "#{Account.count} accounts detected." | |
Each app was configured to use Thin as its web server. |
require 'spec/support/grep_matcher' | |
describe do | |
disallow_presence_of pattern: "send(.*#", | |
location: "app/", | |
description: "Do not use dynamic method invocations", | |
failure: "Please change dynamic method call to something more sane." | |
end |
set :application, '<APP_NAME>' | |
set :repo_url, "<git@PATH/REPO.git>" | |
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp } | |
set :deploy_to, "/home/deploy/rails/<APP_NAME>" | |
# set :scm, :git | |
set :format, :pretty | |
set :log_level, :debug |
Rails as it has never been before :) | |
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring. | |
Note: Some of them are collected from different online resources/posts/blogs with some tweaks. |