<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Bento</title>
    <description>The latest articles on DEV Community by Bento (@bento).</description>
    <link>https://dev.to/bento</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F443115%2F970075e9-2c23-4787-be03-6eb3b3faa5b6.jpeg</url>
      <title>DEV Community: Bento</title>
      <link>https://dev.to/bento</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bento"/>
    <language>en</language>
    <item>
      <title>Use OVH API in Ruby</title>
      <dc:creator>Bento</dc:creator>
      <pubDate>Tue, 18 May 2021 11:30:45 +0000</pubDate>
      <link>https://dev.to/bento/use-ovh-api-in-ruby-e1o</link>
      <guid>https://dev.to/bento/use-ovh-api-in-ruby-e1o</guid>
      <description>&lt;p&gt;&lt;em&gt;If you're searching to quickly copy&amp;amp;paste some code to use OVH's API in Ruby... welcome my friend. &lt;br&gt;
This post is for you. If not, you may not be interested.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Lately I struggled to use OVH's API on a Ruby because there isn't any official wrapper made for Ruby.&lt;/p&gt;

&lt;p&gt;So I followed &lt;a href="https://docs.ovh.com/gb/en/customer/first-steps-with-ovh-api/"&gt;OVH's tutorial&lt;/a&gt; to make a call to their API, and translated it in a simple Ruby script.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: Create your script keys
&lt;/h2&gt;

&lt;p&gt;Fill the informations on &lt;a href="https://api.ovh.com/createToken/"&gt;this page&lt;/a&gt; to create your script credentials. &lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2: Write the Ruby script
&lt;/h2&gt;

&lt;p&gt;Create a file called &lt;em&gt;app.rb&lt;/em&gt; for example, and put the code below :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'httparty'&lt;/span&gt;
&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'digest/sha1'&lt;/span&gt;

&lt;span class="c1"&gt;# CREDENTIALS&lt;/span&gt;
&lt;span class="no"&gt;APPLICATION_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"hDSISKsDSKdSOHIs"&lt;/span&gt; &lt;span class="c1"&gt;# Fill it with your own key&lt;/span&gt;
&lt;span class="no"&gt;APPLICATION_SECRET&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"hHkNkGHkGuyFliuHGIUGiohmoiHHIUGh"&lt;/span&gt; &lt;span class="c1"&gt;# Fill it with your own key&lt;/span&gt;
&lt;span class="no"&gt;CONSUMER_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"hIOHoiNkhIgfOYUmpioGPIuhihujIMUG"&lt;/span&gt; &lt;span class="c1"&gt;# Fill it with your own key&lt;/span&gt;

&lt;span class="no"&gt;BASE_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://eu.api.ovh.com/1.0"&lt;/span&gt;
&lt;span class="no"&gt;QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;BASE_URL&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"/telephony/aliases"&lt;/span&gt;

&lt;span class="c1"&gt;######## STEP 1: CREATE SIGNATURE ########&lt;/span&gt;

&lt;span class="no"&gt;METHOD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"GET"&lt;/span&gt;
&lt;span class="no"&gt;QUERY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"https://eu.api.ovh.com/1.0/telephony/aliases"&lt;/span&gt;
&lt;span class="no"&gt;BODY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;span class="no"&gt;TSTAMP&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;HTTParty&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://eu.api.ovh.com/1.0/auth/time"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;
&lt;span class="no"&gt;SIGNATURE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"$1$"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;Digest&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;SHA1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hexdigest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;APPLICATION_SECRET&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"+"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;CONSUMER_KEY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"+"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;METHOD&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"+"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;QUERY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"+"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;BODY&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"+"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;TSTAMP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;######## STEP 2: GET TELEPHONY ALIASES (e.g) ########&lt;/span&gt;

&lt;span class="n"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="s2"&gt;"headers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"X-Ovh-Application"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;APPLICATION_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"X-Ovh-Consumer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;CONSUMER_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"X-Ovh-Signature"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;SIGNATURE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s2"&gt;"X-Ovh-Timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;TSTAMP&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;aliases&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;HTTParty&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;BASE_URL&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="no"&gt;QUERY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="n"&gt;aliases&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ruby app.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you should see something like :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[
    "xxxxxxxxxx",
    "xxxxxxxxxx",
    "xxxxxxxxxx",
    ...
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ruby</category>
      <category>api</category>
      <category>ovh</category>
    </item>
    <item>
      <title>🛠️ your own awesome GitHub README profile 😍</title>
      <dc:creator>Bento</dc:creator>
      <pubDate>Fri, 31 Jul 2020 17:34:09 +0000</pubDate>
      <link>https://dev.to/bento/how-to-create-your-github-profil-readme-4gii</link>
      <guid>https://dev.to/bento/how-to-create-your-github-profil-readme-4gii</guid>
      <description>&lt;h1&gt;
  
  
  💬 Blah blah blah
&lt;/h1&gt;

&lt;p&gt;These last months, while browsing github profiles, I would sometimes find some developers having kind of a presentation section made in markdown on their github profile. At this time, I was learning at the bootcamp &lt;em&gt;The Hacking Project&lt;/em&gt; and didn't had much time to search about it...&lt;/p&gt;

&lt;p&gt;But this week, I'm on holidays ! So I grabbed this task in my to-do list and decided to do it.&lt;/p&gt;

&lt;p&gt;Here is the result: &lt;a href="https://github.com/davidBentoPereira"&gt;My GitHub README profile&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  ⚙️ Setup : ~1min
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Create a new github repository&lt;/li&gt;
&lt;li&gt;Name it just like your github account&lt;/li&gt;
&lt;li&gt;Check the box allowing you to initiate the repository with a README.md file&lt;/li&gt;
&lt;li&gt;Write your content in mardown syntax (&lt;a href="https://guides.github.com/pdfs/markdown-cheatsheet-online.pdf"&gt;here is a markdown cheatsheet for you&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  🖌️ Pimp your repo
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Insert emoji : 😄 😕 😢
&lt;/h3&gt;

&lt;p&gt;To insert emoji in your makrdown file (.md), just consult one of these resources, choose an emoji and copy the associated code like &lt;code&gt;:seedling:&lt;/code&gt; to paste it in your file.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/davidBentoPereira/ff79445cb502b7ea22581b543af3fb56"&gt;github_emoji.md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/rxaviers/7360908"&gt;Complete list of github markdown emoji markup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Insert cool badges
&lt;/h3&gt;

&lt;p&gt;You may have seen some badges on famous repos while browsing github. Here is how you can add them on your own READMEs.md&lt;/p&gt;

&lt;p&gt;Resources :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://forthebadge.com/"&gt;For the Badge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://shields.io/"&gt;Shields.io: Quality metadata badges for open source projects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://badgen.net/"&gt;Badgen&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  🎉 Inspiration : The cool kids on the block
&lt;/h1&gt;

&lt;p&gt;Browse this resource to find some of the most awesome github profile READMEs, and try to do better !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://awesome-github-readme-profile.netlify.app/"&gt;Awesome github profile ⚡ &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Oh ! By the way... this is my first post on Dev.to 🎉 !&lt;/p&gt;

&lt;p&gt;See ya ✌️&lt;/p&gt;

</description>
      <category>github</category>
      <category>markdown</category>
      <category>branding</category>
      <category>portfolio</category>
    </item>
  </channel>
</rss>
