Skip to content

Instantly share code, notes, and snippets.

View jasonmclaren's full-sized avatar

Jason McLaren jasonmclaren

View GitHub Profile
@jasonmclaren
jasonmclaren / dbox-test.rb
Created March 3, 2012 00:50
Demonstrate dbox memory leak
#!/usr/bin/env ruby
# Remember to set DROPBOX_APP_KEY, DROPBOX_APP_SECRET, DROPBOX_AUTH_KEY, DROPBOX_AUTH_SECRET.
# This script assumes you're using Bundler to control your dbox version.
# You also need to set remote_dir below.
require "rubygems"
require "bundler"
Bundler.setup(:default)
Bundler.require(:default)
# First configure your models to use Amazon s3 as storage option and setup the associated S3 config.
# Then add the classes your want to migrate in the klasses array below.
# Then run rake paperclip_migration:migrate_to_s3
# Should work but this is untested and may need some tweaking - but it did the job for me.
namespace :paperclip_migration do
desc "migrate files from filesystem to s3"
task :migrate_to_s3 => :environment do
# Replace with your real model names. If anyone wants to this could be picked up from args or from configuration.
klasses = [:account, :product, :product_category, :studio]
@jasonmclaren
jasonmclaren / gist:63b709fd0c686eb44225eceef5cd3a73
Created January 15, 2018 19:45
Vagrant Plugin Install - debug output
(sandbox) ~/src/lab (master=) % VAGRANT_LOG=debug vagrant plugin install vagrant-hosts 11:30:41
Ignoring nokogiri-1.6.7.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7.1
Ignoring unf_ext-0.0.7.2 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.2
INFO global: Vagrant version: 2.0.1
INFO global: Ruby version: 2.4.2
INFO global: RubyGems version: 2.6.13
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_OLD_ENV_XPC_SERVICE_NAME="0"
INFO global: VAGRANT_OLD_ENV_OLDPWD="/Users/jason/src"
INFO global: VAGRANT_OLD_ENV_LANG="en_CA.UTF-8"