Skip to content

Instantly share code, notes, and snippets.

View pglombardo's full-sized avatar
🕶️

Peter Giacomo Lombardo pglombardo

🕶️
View GitHub Profile
class RegistrationsController < ApplicationController
STEP_VALIDATIONS = [
%w(first_name last_name),
%w(billing_address)
]
def new
@user = User.new
end
@cpuguy83
cpuguy83 / sidekiqer.rb
Created October 10, 2013 20:33
Run Sidekiq in your main process
require 'sidekiq/cli'
require 'sidekiq/launcher'
module Sidekiqer
Sidekiq = ::Sidekiq.dup
module Sidekiq
CLI = ::Sidekiq::CLI.dup
Launcher = ::Sidekiq::Launcher.dup
::Sidekiq.send(:remove_const, :CLI)
@bmarini
bmarini / default.vcl.pl
Created June 30, 2011 18:01
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)