This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Model using the ghostscript processor | |
class Content < ActiveRecord::Base | |
has_attached_file :resource, | |
:styles => { :preview => ["725x1200>", :jpg], :thumb => ["100x140>", :jpg] }, | |
:processors => [:ghostscript, :thumbnail], | |
:convert_options => { :all => '-colorspace RGB -flatten -density 300 -quality 100' }, | |
:path => ":page_path/:class/:id/:resource_token/:style/:filename" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
If you have a horizontal (or vertical) scroll container and want to set the scroll to center a specific | |
element in the container you can use the following super simple technique. | |
I'm going to show you how it was derived, because it's important to know why, not just how. | |
*/ | |
/* | |
Setup: | |
[HTML] | |
<div class="outer"> |