Skip to content

Instantly share code, notes, and snippets.

@omundu
omundu / saveimages.rb
Created December 12, 2016 22:39 — forked from kfox/saveimages.rb
A quick Ruby script to download PNG, GIF, or JPEG images from a given URL
#!/usr/bin/env ruby
# usage: saveimages.rb <url>
# locally save all images from a web site
require 'nokogiri'
require 'open-uri'
exit if ARGV[0].nil?
@omundu
omundu / deploy.rb
Created April 29, 2016 15:52 — forked from uhlenbrock/deploy.rb
Precompile assets locally for Capistrano deploy
load 'deploy/assets'
namespace :deploy do
namespace :assets do
desc 'Run the precompile task locally and rsync with shared'
task :precompile, :roles => :web, :except => { :no_release => true } do
%x{bundle exec rake assets:precompile}
%x{rsync --recursive --times --rsh=ssh --compress --human-readable --progress public/assets #{user}@#{host}:#{shared_path}}
%x{bundle exec rake assets:clean}
end
@omundu
omundu / application.rb
Created April 29, 2016 15:52 — forked from keighl/application.rb
Faster Rails asset precompilation via Capistrano .. just do it locally!
# Speed things up by not loading Rails env
config.assets.initialize_on_precompile = false