Skip to content

Instantly share code, notes, and snippets.

@jamster
Created March 9, 2011 21:18
Show Gist options
  • Save jamster/863026 to your computer and use it in GitHub Desktop.
Save jamster/863026 to your computer and use it in GitHub Desktop.
Rackspace Cloud Monthly Cost Calculator
header = "RAM Disk Price/Hour Price/Month"
data = <<-TABS
256 MB 10 GB $0.135
512 MB 20 GB $0.15
1024 MB 40 GB $0.18
2048 MB 80 GB $0.24
4096 MB 160 GB $0.36
8192 MB 320 GB $0.60
15872 MB 620 GB $1.08
TABS
x = data.split("\n").map do |x|
arr = x.split("\t")
monthly = arr.last[1..-1].to_f * 24 * 30
arr << "$#{monthly}"
arr.join("\t")
end.join("\n")
puts header
puts x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment