This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### | |
| ### 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 |
NewerOlder