Skip to content

Instantly share code, notes, and snippets.

View kevinmtrowbridge's full-sized avatar

Kevin Trowbridge kevinmtrowbridge

View GitHub Profile
@kevinmtrowbridge
kevinmtrowbridge / rails_4_upgrade_cheatsheet.md
Last active August 29, 2015 14:05
Nova Fabrica Rails 3 to Rails 4 Cheatsheet
@kevinmtrowbridge
kevinmtrowbridge / dj.rake
Created August 27, 2014 22:28
Patched capistrano-novafabrica delayed job for rails 4
namespace :dj do
def delayed_job_command
fetch(:delayed_job_command, 'script/delayed_job')
end
desc "Start delayed_job process"
task :start do
on roles(:app) do
within release_path do
@kevinmtrowbridge
kevinmtrowbridge / gist:846aa5d29e53110f8be7
Created August 4, 2014 23:24
example release plan -- June 2nd, 2012: migrate The Bold Italic from Engineyard to Heroku
RELEASE PLAN
==========================================================================
BEFORE STARTING:
* delete old files
cd ../convert_mysql_to_postgresql
rm *.dump *.sql
hash = {0=>
{:rect_image_file_name=>"strangefitness.jpg",
:rect_image_content_type=>"image/jpeg",
:rect_image_file_size=>128076,
:square_image_file_name=>"strangefitness.jpg",
:square_image_content_type=>"image/jpeg",
:square_image_file_size=>128076},
1=>
{:rect_image_file_name=>"strangefitness.jpg",
:rect_image_content_type=>"image/jpeg",
@kevinmtrowbridge
kevinmtrowbridge / has_delayed_paperclip.rb
Last active August 29, 2015 14:01
delayed_paperclip invoke sweeper with paperclip after_post_process method
# http://stackoverflow.com/questions/14300427/how-do-i-add-a-model-specific-configuration-option-to-a-rails-concern
module HasDelayedPaperclip
extend ActiveSupport::Concern
module ActiveRecord
def custom_process_in_background(name, options = {})
process_in_background(name, options)
include HasDelayedPaperclip
@kevinmtrowbridge
kevinmtrowbridge / gist:1249385
Created September 28, 2011 22:04
bundler error 'Gem::Package::TarInvalidError: tar is corrupt, name contains null byte'
When running 'bundle install', I randomly get this error:
Gem::Package::FormatError: corrupt gem (Gem::Package::TarInvalidError: tar is corrupt, name
contains null byte) in /Users/kmtrowbr/.rvm/gems/ruby-1.9.2-p290@hitrecord/cache/haml-3.1.2.gem
An error occurred while installing haml (3.1.2), and Bundler cannot continue.
Make sure that `gem install haml -v '3.1.2'` succeeds before bundling.
I am using RVM, I started troubleshooting by removing the 'corrupt' file, eventually progressing
all the way to doing an 'rvm implode' and reinstalling everything, including upgrading rails
1.9.2 to the newest version (p290) and upgrading bundler itself to 1.0.20.