Skip to content

Instantly share code, notes, and snippets.

View mauu-alpha's full-sized avatar
🏠
Working from home

Mauro Campillo mauu-alpha

🏠
Working from home
  • none :(
  • Buenos Aires
View GitHub Profile
# config.ru
use Statue::RackStatistics # https://github.com/restorando/statue/blob/master/lib/statue/rack_statistics.rb
# app
Cuba.define do
on get do
on "restaurant/:id/reviews" do
res.write "All reviews"
end
end
require "mini_magick"
module MiniMagick
class Image
def get_dominant_color
color = run_command("convert", path, "-format", "%c\n", "-colors", 1, "-depth", 8, "histogram:info:").split(' ');
# color = " 1764000: (208,195,161) #D0C3A1 srgb(208,195,161)\n\n"
{
hex: color[2],
rgb: color[1][1..-2].split(',')