Skip to content

Instantly share code, notes, and snippets.

development:
adapter: postgresql
encoding: unicode
database: my_store_development
username: my_store
production:
adapter: postgresql
encoding: unicode
database: my_store_production
def obtain_class
class_name = ENV['CLASS'] || ENV['class']
raise "Must specify CLASS" unless class_name
@klass = Object.const_get(class_name)
end
def obtain_attachments
name = ENV['ATTACHMENT'] || ENV['attachment']
raise "Class #{@klass.name} has no attachments specified" unless @klass.respond_to?(:attachment_definitions)
if !name.blank? && @klass.attachment_definitions.keys.include?(name)
Exception
Error
stack level too deep
(eval):1:in `get'
(eval):1:in `get'
/home/maiz/.gem/ruby/1.8/gems/redisk-0.2.0/lib/redisk/stat.rb:359:in `read_attribute'
/home/maiz/.gem/ruby/1.8/gems/redisk-0.2.0/lib/redisk/stat.rb:292:in `size'
/home/maiz/.gem/ruby/1.8/gems/redisk-0.2.0/lib/redisk/io.rb:23:in `initialize'
/home/maiz/.gem/ruby/1.8/gems/redisk-0.2.0/lib/redisk/logger.rb:11:in `new'
$('input#id-do-meu-campo').daterangepicker()
require 'RMagick'
img = Magick::ImageList.new( logo )
white = 768
expected_saturation = white*0.65
colors = []
img.quantize(30).color_histogram.each{|c|
r,g,b = [c[0].red, c[0].green, c[0].blue].map{|c| c/256 }
soma = r + g + b
points = 0