Skip to content

Instantly share code, notes, and snippets.

View fredmp's full-sized avatar

Frederico Porto fredmp

View GitHub Profile
@ezotrank
ezotrank / gist:3910281
Created October 18, 2012 07:27
Paperclip(ImageMagic) resize, crop and other action sheet cheat
'400x300' # resize, maintain aspect ratio
'400x300!' # force resize, don't maintain aspect ratio
'400x' # resize width, maintain aspect ratio
'x300' # resize height, maintain aspect ratio
'400x300>' # resize only if the image is larger than this
'400x300<' # resize only if the image is smaller than this
'50x50%' # resize width and height to 50%
'400x300^' # resize width, height to minimum 400,300, maintain aspect ratio
'2000@' # resize so max area in pixels is 2000
'400x300#' # resize, crop if necessary to maintain aspect ratio (centre gravity)
# vim FTW
Pry.config.editor = "mvim"
# Prompt with ruby version
Pry.prompt = [proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} > " }, proc { |obj, nest_level| "#{RUBY_VERSION} (#{obj}):#{nest_level} * " }]
if defined?(Rails) && Rails.env
begin
extend Rails::ConsoleMethods if defined?(Rails::ConsoleMethods)
require "rails/console/app"
@dennisreimann
dennisreimann / mail.rb
Created October 6, 2010 12:50
CIJoe mail notification script.
#!/usr/bin/env ruby
# CIJoe mail notification script.
# Some things in here are shamelessly ripped from
# http://gist.github.com/374030
#
# Call this from your hooks (build-worked, build-failed) with something like:
# ~/ci/scripts/mail.rb ~/ci/PROJECT/ CIJOE_URL BRANCH
#
# Requirements