Skip to content

Instantly share code, notes, and snippets.

@stouset
stouset / controller.rb
Created October 19, 2011 14:31
Transloadit-Paperclip integration
def decode_transloadit_json
return unless params[:transloadit].present?
# wrap transloadit params in a HashWithIndifferentAccess
params[:transloadit] = ActiveSupport::HashWithIndifferentAccess.new(
ActiveSupport::JSON.decode params[:transloadit]
)
# decode parameters from transloadit
params[:transloadit][:uploads].first.tap do |history|
@karmi
karmi / workers.rake
Created July 22, 2010 15:58
Rake taks to launch multiple Resque workers in development/production with simple management included
# Rake task to launch multiple Resque workers in development/production with simple management included
require 'resque/tasks' # Require Resque tasks
namespace :workers do
# = $ rake workers:start
#
# Launch multiple Resque workers with the Rails environment loaded,
# so they have access to your models, etc.