Skip to content

Instantly share code, notes, and snippets.

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
$('input#id-do-meu-campo').daterangepicker()
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'
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)
development:
adapter: postgresql
encoding: unicode
database: my_store_development
username: my_store
production:
adapter: postgresql
encoding: unicode
database: my_store_production
gem install spree
> spree my_store
create
create CHANGELOG
create CONTRIBUTORS
create INSTALL
create LICENSE
create README.markdown
...
> cd my_store
> sudo rake gems:install
> sudo su postgres
> createuser my_store
Ctrl+D para voltar ao usuário original
> rake db:create