Skip to content

Instantly share code, notes, and snippets.

View tmtk75's full-sized avatar

Tomotaka Sakuma tmtk75

View GitHub Profile
@tmtk75
tmtk75 / color-wheel.rb
Created November 27, 2011 03:30
Color Wheel CSS Generate
#!/usr/bin/ruby
=begin
Script to generate scss for color-wheel.
=end
$saturation = ARGV[0] || 100
$luminousness = ARGV[1] || 50
$split = ARGV[2].to_i || 24
def mk_suffix(deg)
"#{deg}_#{$saturation}_#{$luminousness}"
@tmtk75
tmtk75 / hpricot.rb
Created November 27, 2011 01:55
Hpricot, Ruby scraping library, getting started
require 'hpricot'
require 'open-uri'
doc = Hpricot( open("https://commons.wikimedia.org/wiki/Crystal_Clear").read )
(doc/:a).each do |link|
puts link[:href]
end
@tmtk75
tmtk75 / showcase.yaml
Created February 3, 2011 06:58
YAML showcase
###
### YAML Showcase
### Thanks for http://jp.rubyist.net/magazine/?0009-YAML
### To run:
### cat $0 | ruby -r pp -r yaml -e 'pp YAML.load STDIN.read'
###
collection:
mapping(block-style):
name: Taro
age: 32