Skip to content

Instantly share code, notes, and snippets.

@ntlk
ntlk / ruby_rgb_to_hsb.rb
Created November 21, 2011 19:18
converts RGB values to HSB
# Input rgb values 1...255
# based on http://forums.devshed.com/c-programming-42/rgb-to-hsv-conversion-rountine-162526.html
r = r / 255.0
g = g / 255.0
b = b / 255.0
max = [r, g, b].max
min = [r, g, b].min
delta = max - min
v = max * 100
@ntlk
ntlk / html5.haml
Created September 26, 2011 20:53 — forked from fnhipster/html5.haml
HTML5 HAML Template
!!! 5
%html{ :lang => "en"}
%head
%title= "Your Website"
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }