Skip to content

Instantly share code, notes, and snippets.

@sohda
Last active November 23, 2015 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sohda/20d1b5a2c6c1e438e800 to your computer and use it in GitHub Desktop.
Save sohda/20d1b5a2c6c1e438e800 to your computer and use it in GitHub Desktop.
Try Google Cloud SDK Ruby.
/.bundle
/bundle
*.swp
*.json
source "https://rubygems.org"
gem 'gcloud'
gem 'aws-sdk', '~> 2'
<!DOCTIPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello GCP SDK Ruby</title>
</head>
<body>
<!-- <?xml version="1.0" encoding="UTF-8"?> -->
<svg width="580" height="400" xmlns="http://www.w3.org/2000/svg">
<!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
<g>
<title>background</title>
<rect fill="#fff" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
<g display="none" overflow="visible" y="0" x="0" height="100%" width="100%" id="canvasGrid">
<rect fill="url(#gridpattern)" stroke-width="0" y="0" x="0" height="100%" width="100%"/>
</g>
</g>
<g>
<title>Layer 1</title>
<path d="m228,68.516663c0,0 2.076111,0.617317 3,1c2.613129,1.08239 2.823746,2.486259 5,3c0.973251,0.229752 3,0 4,0c2,0 3,2 5,2c1,0 3.292892,-0.707108 4,0c0.707108,0.707108 2,1 3,1c2,0 3.080246,-0.689262 6,0c2.17627,0.513741 4,1 5,1c2,0 3,0 5,0c1,0 1,-2 1,-3c0,-2 0,-3 0,-5c0,-1 0,-3 0,-5c0,-3 0,-4 0,-6c0,-1 -0.418854,-1.418861 -2,-3c-1.581146,-1.581139 -2.796997,-1.2565 -4,-2c-2.690002,-1.662506 -4.0979,-2.824432 -6,-4c-1.701309,-1.05146 -3.080246,0.689262 -6,0c-2.176254,-0.513741 -3,-1 -5,-1c-1,0 -3,0 -4,0c-2,0 -5,0 -6,0c-2,0 -3.152237,-0.765366 -5,0c-1.306564,0.541199 -3.458801,0.693436 -4,2c-0.765366,1.847755 -2.486267,1.823746 -3,4c-0.229752,0.973251 -2,3 -2,4c0,2 0,3 0,5c0,2 0,4 0,5c0,1 0,3 0,4c0,1 0,3 0,4c0,2 2,3 2,5c0,1 1,3 1,4c0,2 0.234634,3.152245 1,5c0.541199,1.306564 0.692551,2.186005 2,4c1.653809,2.29454 5.458801,3.693436 6,5c0.765366,1.847763 0.948532,2.298691 2,4c1.175568,1.902115 3.298691,-0.051468 5,1c1.902115,1.175568 3.386871,3.917603 6,5c1.847763,0.765366 4,1 5,1c2,0 5,0 9,0c3,0 5,0 7,0c1,0 3,-1 4,-1l2,-2l0,0l2,0" id="svg_6" fill-opacity="null" stroke-width="12.5" stroke="#ffaa56" fill="none"/>
<path d="m305,32.516663c-1,0 -1,1 -1,3c0,3 0,7 0,12c0,3 0,6 0,9c0,3 0,7 0,10c0,4 0,8 0,11c0,3 0,6 0,9c0,4 -1,7 -1,10c0,3 0,6 0,8c0,3 0,6 0,7c0,2 -1,5 -1,6l0,1" id="svg_7" fill-opacity="null" stroke-width="12.5" stroke="#ffaa56" fill="none"/>
<path d="m353,27.516663c-1,0 -1.458801,0.693436 -2,2c-0.765381,1.847759 -0.493469,2.878555 -1,6c-0.48056,2.961262 -1.095428,7.977345 -2,12c-1.118652,4.974792 -1.496216,9.907784 -2,14c-0.488739,3.970032 0.591217,9.029198 0,15c-0.502441,5.074203 -1.493469,9.878555 -2,13c-0.640717,3.948349 -1,7 -1,10c0,2 0,4 0,7c0,2 -0.458801,3.693436 -1,5c-0.765381,1.847755 0,3 0,5l0,1" id="svg_8" fill-opacity="null" stroke-width="12.5" stroke="#ffaa56" fill="none"/>
<path d="m421,56.516663c-1,0 -2,0 -4,0c-1,0 -3,0 -6,0c-3,0 -5,0 -8,0c-3,0 -5.042908,-0.289787 -6,0c-3.450836,1.04483 -6,3 -8,5c-1,1 -3.173096,2.85273 -4,4c-1.307465,1.813995 -2.493469,4.878555 -3,8c-0.48056,2.961266 -0.486267,4.823746 -1,7c-0.229767,0.973251 0,4 0,6c0,1 0,3 0,5c0,2 0.95517,2.549156 2,6c0.579559,1.914185 3,5 5,7c2,2 3.06601,2.877655 5,4c3.118469,1.809723 5.31076,2.534927 7,4c2.388947,2.07193 6,1 9,1c2,0 4,0 5,0c3,0 6,0 7,0c3,0 5,0 6,-1c2,-2 2.61731,-2.076126 3,-3c0.541199,-1.306564 2.0979,-2.824432 4,-4c0.850647,-0.525726 0.585785,-1.585785 2,-3c0.707092,-0.707108 0.770233,-2.026749 1,-3c0.513733,-2.176254 2.770233,-5.026749 3,-6c0.513733,-2.176254 0.540497,-3.053505 1,-5c0.513733,-2.176254 1,-4 1,-5c0,-2 0,-3 0,-4c0,-2 1.051453,-3.298698 0,-5c-1.175568,-1.902115 -1.61731,-3.076118 -2,-4c-1.082397,-2.613129 -3.486267,-2.823746 -4,-5c-0.229767,-0.973251 -2,-1 -2,-2c0,-2 -1.852722,-2.173096 -3,-3c-1.813995,-1.307449 -3,-2 -5,-3l-1,-1l-2,0" id="svg_9" fill-opacity="null" stroke-width="12.5" stroke="#ffaa56" fill="none"/>
<path d="m147,4.516663c0,0 0,2 0,3c0,2 -0.917603,2.386875 -2,5c-0.38269,0.923878 -0.486252,3.82375 -1,6c-0.459503,1.946499 -0.54863,4.769928 -2,9c-1.654816,4.823029 -1,9 -1,11c0,3 -0.486252,5.823746 -1,8c-0.689255,2.919746 -1,6 -1,9c0,5 0,6 0,9c0,2 0,3 0,5c0,1 0,3 0,6c0,2 -2,3 -2,6c0,1 0,3 0,4c0,2 0,3 0,4c0,2 0,3 0,5c0,1 0,3 0,4c0,2 0,3 0,5c0,1 0,4 0,6c0,1 -1,4 0,4c1,0 0,-3 0,-4c0,-2 0,-3 0,-5c0,-1 0,-3 0,-4c0,-2 -0.689255,-3.080246 0,-6c0.513748,-2.176254 1.080994,-9.107002 2,-13c0.513748,-2.176254 -0.414215,-4.585785 1,-6c0.707108,-0.707108 1,-2 1,-3c0,-1 -0.38269,-3.076118 0,-4c1.082397,-2.613129 2.292892,-2.292892 3,-3c0.707108,-0.707108 1.234634,-1.152245 2,-3c0.541199,-1.306564 2.298706,0.05146 4,-1c1.902115,-1.175568 2.693436,-2.458801 4,-3c1.847763,-0.765366 3,0 5,0c1,0 2.386871,-0.91761 5,-2c1.847763,-0.765366 3,0 5,0c1,0 3.026749,1.770248 4,2c2.176254,0.513741 3.585785,1.585785 5,3c0.707108,0.707108 1.824432,1.097885 3,3c1.051453,1.701302 1,2 1,3c0,2 2,3 2,5c0,1 0,3 0,4c0,2 0,3 0,5c0,1 -0.824432,2.097885 -2,4c-1.051453,1.701302 0,3 0,4c0,2 -0.585785,1.585785 -2,3c-1.414215,1.414215 0,3 0,5c0,1 0,3 0,4c0,2 0,3 0,5c0,1 0,3 0,4c0,2 2,2 3,2c1,0 1,1 3,1c1,0 3,0 4,0c2,0 3,0 5,0c1,0 3,0 4,0l2,0l1,0" id="svg_10" fill-opacity="null" stroke-width="12.5" stroke="#ffaa56" fill="none"/>
<path d="m77,176.516663c0,-1 -0.149345,-1.474274 -1,-2c-1.902115,-1.175568 -1.386871,-2.917603 -4,-4c-0.923882,-0.38269 -3,0 -4,0c-2,0 -3,0 -5,0c-2,0 -3,0 -6,0c-1,0 -3.149345,-0.525726 -4,0c-1.902115,1.175568 -2.85273,2.173096 -4,3c-1.813995,1.307449 -3.211678,3.714127 -6,6c-2.18734,1.793198 -2.234634,3.152237 -3,5c-1.08239,2.613129 -3.486259,4.823746 -4,7c-0.459503,1.946503 -0.770248,4.026749 -1,5c-0.513741,2.176254 -1,5 -1,6c0,2 0.513008,2.593994 2,5c1.662506,2.689987 2.418861,5.418854 4,7c1.581139,1.581146 3.513008,4.593994 5,7c1.662506,2.690002 4.310005,5.337494 7,7c2.406006,1.487 3,2 5,2c1,0 3,0 6,0c3,0 5,0 6,0c2,0 2.823746,-0.486267 5,-1c0.973251,-0.229736 3,-2 4,-2c2,0 3.585785,0.414215 5,-1c1.414215,-1.414215 0.61731,-2.076111 1,-3c0.541199,-1.306564 2.917603,-1.386871 4,-4c0.38269,-0.923874 1,-3 1,-4c0,-2 0,-3 0,-5c0,-1 1,-2 1,-3c0,-2 0,-3 0,-5c0,-1 -0.292892,-2.292892 -1,-3c-0.707108,-0.707108 -3.022476,-0.633453 -6,-1c-4.092216,-0.503769 -7,-1 -10,-2l-3,0l-2,0" id="svg_11" fill-opacity="null" stroke-width="12.5" stroke="#aaff56" fill="none"/>
<path d="m165,349.516663c0,-1 1,-3 1,-4c0,-2 1.704376,-5.014587 2,-8c0.502441,-5.074219 1,-10 1,-13c0,-4 2,-9 2,-12c0,-3 0,-6 0,-8c0,-2 -0.320374,-4.025818 0,-6c0.506531,-3.121429 1,-4 1,-7c0,-3 0,-5 0,-8c0,-3 2,-6 2,-7c0,-2 0.486267,-2.823761 1,-5c0.229767,-0.973236 0,-2 0,-4c0,-1 1,-1 3,-1c1,0 3,0 4,0c2,0 4.026764,-0.229767 5,0c2.176239,0.513733 4.878571,3.493469 8,4c0.987091,0.160187 3.298706,-0.051453 5,1c1.9021,1.175568 2.418854,1.418854 4,3c1.581146,1.581146 2.789856,3.07843 4,6c0.855713,2.065857 1.917603,2.386871 3,5c0.38269,0.923889 0,3 0,4c0,2 1,3 1,5c0,1 0,3 0,4c0,2 1.051453,3.298706 0,5c-1.175568,1.9021 -3.824432,2.0979 -5,4c-0.525726,0.850647 -1.31076,2.534912 -3,4c-2.388947,2.07193 -5.07843,2.789856 -8,4c-2.065857,0.855713 -3.823761,2.486267 -6,3c-0.973236,0.229767 -3,0 -4,0c-2,0 -3,0 -5,0c-1,0 -3.292908,0.707092 -4,0c-0.707092,-0.707092 0,0 0,2c0,1 0.486267,3.823761 1,6c0.229767,0.973236 1,3 3,5c1,1 2.386871,4.917603 5,6c0.923889,0.38269 3.07843,-0.210144 6,1c2.065857,0.855713 5,1 6,1c2,0 3,0 5,0c1,0 3,0 4,0c2,0 3,0 5,0c1,0 1.152252,-1.234619 3,-2c1.306549,-0.541199 3,-1 4,-2l2,-2l1,0" id="svg_12" fill-opacity="null" stroke-opacity="null" stroke-width="12.5" stroke="#ff5656" fill="none"/>
<path d="m238,310.516663c0,1 0,2 0,4c0,1 0.229767,3.026764 0,4c-0.513733,2.176239 -1,3 -1,5c0,3 -0.95517,3.549164 -2,7c-0.579559,1.914185 0,4 0,7c0,1 0,3 0,4c0,2 0.917603,2.386871 2,5c0.38269,0.923889 1,3 2,3c2,0 3,0 5,0c1,0 3,0 4,0c2,0 2.823761,-1.486267 5,-2c1.946503,-0.459503 1.585785,-1.585785 3,-3c1.414215,-1.414215 2.292908,-0.292908 3,-1c1.414215,-1.414215 1.173096,-2.852722 2,-4c1.307465,-1.813995 3,-3 3,-4c0,-2 -0.765381,-3.152252 0,-5c0.541199,-1.306549 1,-3 1,-4c0,-2 0.917603,-2.386871 2,-5c0.38269,-0.923889 0,-3 0,-4c0,-2 0,-3 0,-5c0,-1 0,0 0,2c0,2 0,3 0,6c0,3 0.160187,5.012909 0,6c-0.506531,3.121429 -1,6 -1,8c0,1 0,3 0,4c0,2 0,4 0,7c0,2 0,4 0,5l0,2l0,1l1,0" id="svg_13" fill-opacity="null" stroke-opacity="null" stroke-width="12.5" stroke="#ff5656" fill="none"/>
<path d="m301,264.516663c0,1 0,2 0,5c0,3 0,5 0,8c0,3 0,6 0,9c0,3 0,5 0,8c0,3 0,8 0,10c0,3 0,6 0,9c0,3 0,4 0,6c0,2 0,4 0,5c0,3 0,5 0,8c0,1 0,3 0,4c0,1 0,3 0,4c0,2 0,3 0,0c0,-1 0,-5 0,-8c0,-2 0,-3 0,-6c0,-1 0,-3 0,-6c0,-3 -0.765381,-4.152252 0,-6c1.082397,-2.613129 1.337494,-3.309998 3,-6c1.487,-2.406006 3,-4 4,-5c2,-2 2.823761,-2.486267 5,-3c2.919739,-0.68927 5,0 7,0c1,0 3,0 4,0c2,0 3,0 5,0c1,0 3.076111,-0.38269 4,0c2.613129,1.082397 3.824432,2.0979 5,4c0.525726,0.850647 0,2 2,4c1,1 0.770233,3.026764 1,4c0.513733,2.176239 1,3 1,6c0,2 2,3 2,5c0,1 0,3 0,4c0,2 -1.0979,3.824432 -3,5c-1.701294,1.051453 -3.152252,1.234619 -5,2c-1.306549,0.541199 -3.076111,0.61731 -4,1c-2.613129,1.082397 -5.106995,1.080994 -9,2c-2.176239,0.513733 -4.076111,0.61731 -5,1c-2.613129,1.082397 -4,2 -5,2c-2,0 -3.585785,-1.414215 -5,0c-0.707092,0.707092 -1,1 -3,1l-1,0" id="svg_14" fill-opacity="null" stroke-opacity="null" stroke-width="12.5" stroke="#ff5656" fill="none"/>
<path d="m366,291.516663c0,1 0,3 0,4c0,2 0.486267,2.823761 1,5c0.229767,0.973236 0.292908,2.292908 1,3c2.121338,2.121307 1.458801,4.693451 2,6c0.765381,1.847748 2.144287,2.934143 3,5c1.210144,2.92157 2.206787,4.812653 4,7c2.285889,2.78833 3,5 3,7l2,1l1,0l0,2" id="svg_15" fill-opacity="null" stroke-opacity="null" stroke-width="12.5" stroke="#ff5656" fill="none"/>
<path d="m413,294.516663c-1,0 -1,2 -2,3c-1,1 -2.770264,2.026764 -3,3c-0.513733,2.176239 -2.418884,3.418854 -4,5c-1.581116,1.581146 -2,3 -2,4c0,2 -2.458801,1.693451 -3,3c-1.148071,2.771637 0.414185,3.585785 -1,5c-1.414185,1.414215 -1.234619,0.152252 -2,2c-0.541199,1.306549 -2.770264,3.026764 -3,4c-0.513733,2.176239 -2,3 -3,4c-1,1 -0.386841,2.917603 -3,4c-0.923889,0.38269 -2.076111,0.61731 -3,1c-2.613159,1.082397 -2,3 -4,3c-1,0 -8.824463,2.0979 -10,4c-0.525757,0.850647 -1.298706,-0.051453 -3,1c-1.9021,1.175568 -3,2 -4,3c-2,2 -3.026764,1.770233 -4,2c-2.176239,0.513733 -3.026764,1.770233 -4,2c-2.176239,0.513733 -3.186005,0.692535 -5,2c-1.147278,0.826904 -3,2 -4,2c-2,0 -2,1 -3,1c-2,0 -3.152252,1.234619 -5,2c-1.306549,0.541199 -2,3 -5,3c-2,0 -2.693451,0.458801 -4,1c-1.847748,0.765381 -2.386871,0.917603 -5,2c-0.923889,0.38269 -3,1 -4,1c-2,0 -3,2 -4,2c-2,0 -3,0 -5,0l-1,0" id="svg_16" fill-opacity="null" stroke-width="12.5" stroke="#ff5656" fill="none"/>
<path d="m154,177.516663c0,-1 -0.292892,-1.292892 -1,-2c-1.414215,-1.414215 -2.761078,-2.415894 -6,-4c-2.840729,-1.389359 -4.823746,-1.486252 -7,-2c-0.973251,-0.229752 -1,-1 -3,-1c-1,0 -3,0 -4,0c-2,0 -5,0 -6,0c-2,0 -2.823746,0.486252 -5,1c-0.973251,0.229752 -1.585785,1.585785 -3,3c-0.707108,0.707108 -1.585785,-0.414215 -3,1c-1.414215,1.414215 -0.458801,2.693436 -1,4c-0.765366,1.847763 -2,3 -2,5c0,1 0,3 0,4c0,1 0,2 0,4c0,1 0,3 0,4c0,2 0,3 0,5c0,1 0,3 0,4c0,2 0,4 0,5c0,3 2.458801,3.693436 3,5c0.765366,1.847763 1,2 2,3c1,1 3.693436,2.458801 5,3c0.923874,0.38269 3,2 4,2c2,0 4,1 7,1c2,0 4,0 5,0c2,0 3,0 5,0c1,0 3,0 4,0c3,0 5,0 5,0c2,0 2.692551,-1.186005 4,-3c0.826904,-1.147263 1.292892,-3.292892 2,-4c1.414215,-1.414215 2,-2 2,-3l1,-1l0,-2" id="svg_17" fill-opacity="null" stroke-width="12.5" stroke="#56ffff" fill="none"/>
<path d="m194,232.516663c0,0 0,-2 0,-3c0,-2 0,-3 0,-6c0,-1 0,-3 0,-4c0,-2 0,-4 0,-5c0,-2 0,-5 0,-6c0,-2 -0.95517,-2.549149 -2,-6c-0.579575,-1.914185 0.229752,-4.026749 0,-5c-0.513748,-2.176254 -1,-4 -1,-5c0,-2 0,-4 0,-6c0,-1 0,-4 0,-6c0,-1 0,-3 0,-4c0,-2 0,-3 0,-6c0,-3 0,-4 0,-6c0,-1 3.128723,-0.130646 6,-1c3.450851,-1.04483 7,-2 9,-2c1,0 3.186005,-0.307449 5,1c1.147278,0.826904 3.705475,2.346191 6,4c1.813995,1.307449 4.0979,1.824432 6,3c0.850647,0.525726 1.0979,0.824432 3,2c1.701294,1.051468 2.234619,1.152237 3,3c0.541199,1.306564 3,1 3,3c0,2 -0.765381,3.152237 0,5c0.541199,1.306564 1,4 1,5c0,2 0,3 0,5c0,1 0.147278,3.173096 -1,4c-1.813995,1.307449 -3.025818,2.679642 -5,3c-3.121429,0.506546 -3.386871,1.917603 -6,3c-0.923889,0.38269 -2.823761,0.486252 -5,1c-0.973236,0.229752 -3,0 -4,0c-2,0 -3,0 -5,0c-1,0 -3,0 -6,0l-2,0" id="svg_18" fill-opacity="null" stroke-width="12.5" stroke="#ff5656" fill="none"/>
<path d="m343,172.516663c0,0 0.176239,-2.486252 -2,-3c-0.973236,-0.229752 -2.823761,-0.486252 -5,-1c-2.919739,-0.689255 -6,0 -7,0c-2,0 -5,0 -7,0c-3,0 -4,0 -6,0c-1,0 -2.234619,0.152237 -3,2c-0.541199,1.306564 -3,2 -3,4c0,1 0,3 0,4c0,2 0,3 0,5c0,1 0.418854,2.418854 2,4c1.581146,1.581146 1,3 3,5c1,1 3.076111,2.61731 4,3c1.306549,0.541199 2.693451,1.458801 4,2c1.847748,0.765366 5,1 6,1c3,0 6,1 7,1c2,0 3,0 5,0c1,0 2.824432,1.097885 4,3c1.051453,1.701309 1,2 1,3c0,2 2,3 2,5c0,1 0,3 0,4c0,1 0,3 0,4c0,2 1.051453,3.298691 0,5c-1.175568,1.902115 -3.152252,2.234634 -5,3c-1.306549,0.541199 -1.549164,1.95517 -5,3c-1.914185,0.579575 -3.228363,-1.148056 -6,0c-1.306549,0.541199 -3,1 -4,1c-2,0 -3,0 -5,0c-1,0 -3,0 -4,0c-2,0 -4,0 -5,0c-2,0 -1.585785,-0.585785 -3,-2c-1.414215,-1.414215 -1.585785,-1.585785 -3,-3c-1.414215,-1.414215 -1.234619,-1.152237 -2,-3c-0.541199,-1.306564 -0.292908,-3.292892 -1,-4c-1.414215,-1.414215 -2,-2 -2,-3l0,-2" id="svg_26" fill-opacity="null" stroke-width="12.5" stroke="#b2b2b2" fill="none"/>
<path d="m392,227.516663c0,-1 -2,-3 -2,-5c0,-1 -1,-4 -1,-7c0,-1 0,-4 0,-5c0,-2 0,-3 0,-5c0,-1 -2,-3 -2,-4c0,-2 0,-3 0,-5c0,-1 0,-3 0,-4c0,-2 0.160187,-4.012909 0,-5c-0.506531,-3.121445 -1,-4 -1,-6c0,-1 0,-3 0,-6c0,-1 -0.707092,-3.292892 0,-4c1.414215,-1.414215 2.878571,0.493454 6,1c1.974182,0.320358 2.585785,1.585785 4,3c1.414215,1.414215 2.292908,0.292892 3,1c1.414215,1.414215 2.585785,-0.414215 4,1c0.707092,0.707108 1.917603,0.386871 3,3c0.38269,0.923874 1.292908,1.292892 2,2c1.414215,1.414215 1.486267,2.823746 2,5c0.229767,0.973251 0.585785,1.585785 2,3c0.707092,0.707108 0.458801,2.693436 1,4c0.38269,0.923874 2,3 2,4c0,2 -0.765381,3.152237 0,5c0.541199,1.306564 1,3 1,4c0,2 0,3 0,5c0,1 -0.458801,2.693436 -1,4c-0.765381,1.847763 -2,2 -3,3c-2,2 -3.585785,0.585785 -5,2c-0.707092,0.707108 -1,1 -3,1c-1,0 -3,2 -4,2c-2,0 -3.298706,-1.051468 -5,0c-1.9021,1.175568 -3,2 -4,2l0,1" id="svg_27" fill-opacity="null" stroke-width="12.5" stroke="#b2b2b2" fill="none"/>
<path d="m451,164.516663c1,0 1,2 1,5c0,3 0,4 0,7c0,3 1,7 1,11c0,4 0,6 0,8c0,1 1,3 1,6c0,1 0,3 0,4c0,2 0,3 0,5c0,1 0,3 0,4c0,1 1,4 1,5c0,2 0,3 0,5l0,1l0,2" id="svg_28" fill-opacity="null" stroke-width="12.5" stroke="#b2b2b2" fill="none"/>
<path d="m453,197.516663c1,0 4.2771,0.771988 8,-1c4.514679,-2.148865 6.549164,-3.95517 10,-5c1.914185,-0.579575 3,-1 4,-1c2,0 3.152252,-0.234634 5,-1c1.306549,-0.541199 3.076111,-1.61731 4,-2c2.613129,-1.082397 3,-3 5,-5c1,-1 1.585785,-1.585785 3,-3c0.707092,-0.707108 0.386871,-1.917603 3,-3c0.923889,-0.38269 1,-1 3,-1l0,-2" id="svg_29" fill-opacity="null" stroke-width="12.5" stroke="#b2b2b2" fill="none"/>
<path d="m469,196.516663c1,1 -0.07193,2.611038 2,5c1.465088,1.68924 2.292908,2.292892 3,3c0.707092,0.707108 -0.414215,1.585785 1,3c1.414215,1.414215 0.585785,1.585785 2,3c0.707092,0.707108 0.538696,1.60643 3,3c3.587921,2.031448 6.549164,3.95517 10,5c0.957092,0.28978 1.585785,0.585785 3,2c0.707092,0.707108 2,0 4,0c1,0 3,0 4,0l2,0" id="svg_30" fill-opacity="null" stroke-width="12.5" stroke="#b2b2b2" fill="none"/>
</g>
</svg>
</body>
</html>
require 'aws-sdk'
require 'json'
creds = JSON.load(File.read('secrets.json'))
Aws.config[:credentials] = Aws::Credentials.new(creds['AccessKeyId'], creds['SecretAccessKey'])
region = 'us-east-1'
s3 = Aws::S3::Client.new(region: region, http_proxy: ENV['http_proxy'])
bucket_name = "hello-aws-sdk-ruby-v2"
target_file_path = "hello-gcp-sdk-ruby.html"
bucket = s3.create_bucket(bucket: bucket_name)
File.open(target_file_path, "rb") do |file|
s3.put_object(
bucket: bucket_name, acl: "public-read", body: file, key: target_file_path
)
end
bucket = Aws::S3::Object.new(bucket_name, target_file_path, region: region)
public_url = bucket.public_url
#puts public_url
cmd = %Q|curl -s #{public_url} -o /dev/null -w "%{time_total}" 2> /dev/null|
times = []
100.times { times << `#{cmd}`.to_f }
p times.inject(:+) / times.size
require "gcloud"
gcloud = Gcloud.new ENV["GCP_PROJECT_NAME"], ENV["GCP_SERVICE_ACCOUNT_CREDENCIAL_FILE_PATH"]
storage = gcloud.storage
bucket = storage.create_bucket "hello-gcp-sdk-ruby"
# generated the svg file: http://editor.method.ac/
file = bucket.create_file "hello-gcp-sdk-ruby.html"
file.acl.public!
public_url = file.public_url
cmd = %Q|curl -s #{public_url} -o /dev/null -w "%{time_total}" 2> /dev/null|
times = []
100.times { times << `#{cmd}`.to_f }
p times.inject(:+) / times.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment