Skip to content

Instantly share code, notes, and snippets.

@PharaohKJ
Last active December 1, 2019 11:21
Show Gist options
  • Save PharaohKJ/0316d26bb190d0a3a6d2dbc9c1f62bda to your computer and use it in GitHub Desktop.
Save PharaohKJ/0316d26bb190d0a3a6d2dbc9c1f62bda to your computer and use it in GitHub Desktop.
placehold.jp さんを利用してサンプル画像ファイルを作成しまくる
%w[
160x90
160x120
320x180
320x240
640x360
640x480
1280x720
1280x960
].each do |size|
%w[png jpg].each do |ext|
(1..5).each do |count|
color1 = (0..5).map { rand(15).to_s(16) }.join
color2 = color1.chars.map { |c| (16 - c.to_i(16)).to_s(16) }.join
system "wget http://placehold.jp/24/#{color1}/#{color2}/#{size}.#{ext}?text=#{size}-#{count}-#{ext} -O #{size}-#{count}.#{ext}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment