NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
Symptoms may include: | |
1. Knowing that you will have to write a router for the 10th time just because someone said YAGNI | |
(and knowing that having said "router" you would likely want it _both_ ways, yes I mean it thank you) | |
2. When talking about yourself as a developer you say | |
things like "I escape my URLs and preferably auto, and yes this includes the router" | |
3. You know you just don't need to rememder to have a form tag without do..end. because you use markaby anyway. | |
And you want your URL escaped | |
4. It doesn't feel right unless you have snatched escape_and_sanitize_ugly_html_gunk from bigframework and | |
of course you find out that it requires bigframework-*.gem, and the backing class for escape_and_sanitize |
# Author: Cyril Rohr | |
require 'rubygems' | |
require 'rest_client' # sudo gem install rest-client | |
require 'rack/cache' # sudo gem install rack-cache | |
module RestClient | |
# this is a quick hack to show how you can use rack-cache as a powerful client cache. | |
class CacheableResource < Resource | |
attr_reader :cache | |
CACHE_DEFAULT_OPTIONS = {}.freeze |
namespace :deploy do | |
desc 'Bundle and minify the JS and CSS files' | |
task :precache_assets, :roles => :app do | |
root_path = File.expand_path(File.dirname(__FILE__) + '/..') | |
jammit_path = Dir["#{root_path}/vendor/gems/jammit-*/bin/jammit"].first | |
yui_lib_path = Dir["#{root_path}/vendor/gems/yui-compressor-*/lib"].first | |
assets_path = "#{root_path}/public/assets" | |
# Precaching assets | |
run_locally "ruby -I#{yui_lib_path} #{jammit_path}" |
require "net/http" | |
# Veeery simple recaptcha client. | |
# In your controller or filter | |
# @recaptcha = Recaptcha.new(:pubkey => your_public_key, :privkey => your_private_key) | |
# In the view | |
# <%= @recaptcha.form %> | |
# In the accepting action, rescue from Recaptcha::Failed | |
# begin | |
# @recaptcha.verify!(:env => env, :params => params) |
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
require "rails" | |
# Let's load only action controller. If you want | |
# to use active record, just require it as well. | |
require "action_controller/railtie" | |
class MyApp < Rails::Application |
.ui | |
{ | |
background-image: url(sprite.png); | |
} | |
@media only screen and (-webkit-min-device-pixel-ratio: 2) { | |
.ui | |
{ | |
background-image: url(sprite2x.png); | |
background-size: 400px 200px; | |
} |
NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths
Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Beamr, probably.
First, verify they actually have a product to sell that actually exists and can be tested in-house.
Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.
"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Beamr, probably.
First, verify they actually have a product to sell that actually exists and can be tested in-house.
Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.