Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JadedEvan's full-sized avatar

Evan Reeves JadedEvan

View GitHub Profile
@JadedEvan
JadedEvan / Ruby resized square thumbnails
Created April 20, 2010 18:01
Snippet of code that uses imagemagick to create a resized, square and centered thumbnail
`convert -resize x#{thisSize.to_i*2} -resize 50% -gravity center -crop #{thisSize}x#{thisSize}+0+0 +repage #{amazon_file[:tempfile].path} #{tempfile_new.path}`
@JadedEvan
JadedEvan / s3cmd bucket to bucket copy
Created March 29, 2010 22:37
Copy files from one S3 bucket to another
#!usr/bin/env ruby
# This script takes a list of filenames from a given file and copies
# each of those files from one S3 bucket to another using the s3mcd library.
# Inputfile should have each filename termination by a newline character.
file, from, to = ARGV[0], ARGV[1], ARGV[2]
if file.nil? || from.nil? || to.nil?
puts "Invalid arguements. Should be filename from-s3-bucket to-s3-bucket"