<?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: Emanuele 🍕</title>
    <description>The latest articles on DEV Community by Emanuele 🍕 (@etozzato).</description>
    <link>https://dev.to/etozzato</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%2F236254%2F064c2b48-957d-4c50-a844-bc39aba848fe.jpg</url>
      <title>DEV Community: Emanuele 🍕</title>
      <link>https://dev.to/etozzato</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/etozzato"/>
    <language>en</language>
    <item>
      <title>Instantiation or !Instantiation of Ruby classes?</title>
      <dc:creator>Emanuele 🍕</dc:creator>
      <pubDate>Mon, 04 May 2020 10:34:11 +0000</pubDate>
      <link>https://dev.to/etozzato/instantiation-or-instantiation-of-ruby-classes-4pc</link>
      <guid>https://dev.to/etozzato/instantiation-or-instantiation-of-ruby-classes-4pc</guid>
      <description>&lt;p&gt;The other day I was thinking,&lt;/p&gt;

&lt;p&gt;should I always aim for the least memory use when I write Rails code or is any effort unimportant, given that behind the few lines of my own code there is always a plethora of framework calls?&lt;/p&gt;

&lt;p&gt;We're now discussing the ethics of our &lt;code&gt;RejectPendingOrderJob&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Simply put, an order is created in &lt;code&gt;pending&lt;/code&gt; state and automatically &lt;code&gt;rejected&lt;/code&gt; in 72 hours unless it has been &lt;code&gt;approved&lt;/code&gt; in the meanwhile. &lt;/p&gt;

&lt;p&gt;The job is enqueued with every &lt;code&gt;pending&lt;/code&gt; order created, will execute in 72 hours and should do nothing unless the order is still &lt;code&gt;pending&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="c1"&gt;# I believe a single SQL statement can execute this elegantly&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;perform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="no"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;id: &lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;state: :pending&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;state: :rejected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="c1"&gt;# The counter proposal involves the instantiation of the class, which I believe is redundant. &lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;perform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;order_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rejected!&lt;/span&gt; &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;accepted?&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h5&gt;
  
  
  What is your preference?
&lt;/h5&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Commander Lazy</title>
      <dc:creator>Emanuele 🍕</dc:creator>
      <pubDate>Wed, 11 Mar 2020 11:06:33 +0000</pubDate>
      <link>https://dev.to/etozzato/commander-lazy-kf3</link>
      <guid>https://dev.to/etozzato/commander-lazy-kf3</guid>
      <description>&lt;p&gt;The other day I was thinking,&lt;/p&gt;

&lt;p&gt;I spend way too much time going up my terminal history, so I tried to create an alias with the grep command and my life got immediately better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias ??='history | grep '
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I can now pick and replay the command I need:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/WorkSpace/ : ?? yarn
   10  yarn dev
   14  yarn install
   16  yarn dev -- -p 5783
   23  yarn build-storybook
   24  yarn run-storybook
   63  yarn
   65  yarn
   87  yarn
   89  yarn
   90  yarn
   96  yarn
  135  yarn add eslint --dev
  136  yarn add @typescript-eslint/parser --save-dev
  144  yarn
  154  rm  admin-client/yarn-error.log
  170  rm -f yarn.lock
  171  rm -f admin-client/yarn.lock
  174  cd admin-client &amp;amp;&amp;amp; yarn install
  175  cd .. &amp;amp;&amp;amp; yarn install
  183  rm -f yarn.lock
  184  rm -f admin-client/yarn.lock
  187  cd admin-client &amp;amp;&amp;amp; yarn install
  188  cd .. &amp;amp;&amp;amp; yarn install
  193  co -- yarn.lock
  245  rm -f yarn.lock
  246  rm -f admin-client/yarn.lock
  249  cd admin-client &amp;amp;&amp;amp; yarn install
  250  cd .. &amp;amp;&amp;amp; yarn install
  255  yarn build
  256  yarn build
  270  yarn build
  294  yarn build
  297  yarn build
  299  yarn build
  300  yarn build
  303  yarn build
  304  yarn build
  305  yarn build
  384  co -- admin-client/yarn.lock
  503  ?? yarn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;But then I quickly became tired with the copy-paste routine and looked into hotkeys (I am using iTerm). &lt;/p&gt;

&lt;p&gt;It turns out that Settings &amp;gt; Pointer &amp;gt; Bindings could really implement what I needed: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0RaAfCMS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xrgqncuvv6vcjswmxv5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0RaAfCMS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xrgqncuvv6vcjswmxv5p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now I can simply select the command I need, CMD+right click and voilá :) &lt;/p&gt;

</description>
      <category>bash</category>
    </item>
    <item>
      <title>How to avoid half-assing all things</title>
      <dc:creator>Emanuele 🍕</dc:creator>
      <pubDate>Sat, 07 Mar 2020 12:28:53 +0000</pubDate>
      <link>https://dev.to/etozzato/how-to-avoid-half-assing-all-things-42ji</link>
      <guid>https://dev.to/etozzato/how-to-avoid-half-assing-all-things-42ji</guid>
      <description>&lt;p&gt;The other day I was thinking, &lt;/p&gt;

&lt;p&gt;I do not have a lack of ideas, I do not have a lack of enthusiasm to start a project, but I possess an incredible track record for stashing half-done things at different stages of their lifecycle. I don't think I am alone. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F52bwd6kdbjf9a6fhz4fi.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F52bwd6kdbjf9a6fhz4fi.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Seven years back for example, after a few &lt;a href="https://italianmondays.com/tagged/cheese" rel="noopener noreferrer"&gt;culinary posts&lt;/a&gt; sent into the obvious void and even an attempt to &lt;a href="https://www.youtube.com/watch?v=_740fJOabYo" rel="noopener noreferrer"&gt;be on camera&lt;/a&gt; immediately destroyed by hate comments, I "realized" the world needed &lt;a href="https://cookq.herokuapp.com" rel="noopener noreferrer"&gt;a GitHub for recipes&lt;/a&gt; and jumped headfirst into the project. It went well, iterating rapidly from napkin sketch to mockup to production (with a &lt;a href="https://cookq.tumblr.com" rel="noopener noreferrer"&gt;side of social&lt;/a&gt;) where it slowly died, maybe because of the engineering effort drying me up or simply because &lt;em&gt;If you build it, they will come&lt;/em&gt; is one huge bias of programmers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ip0g9600vtozinpt8rp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7ip0g9600vtozinpt8rp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmhvl7bsf94tdvxk8b7hv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmhvl7bsf94tdvxk8b7hv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This project (and several others) died and it will never serve a purpose, and it's a shame because - possibly - someone, somewhere might be commencing the development of a similar web app, from scratch. &lt;/p&gt;

&lt;p&gt;I've thought of selling the app (that idea lasted 12 seconds), I thought of open-sourcing the project (making it &lt;em&gt;yet another unmaintained codebase&lt;/em&gt;), but maybe what we need, &lt;strong&gt;hear me out&lt;/strong&gt;, is a convention to transfer a project and retain a fractional interest: a standard agreement and a common tag to find opportunities!&lt;/p&gt;

&lt;p&gt;Example: &lt;em&gt;Here is 95% of the thing I've developed over years of sweat and tears,&lt;br&gt;
let me keep 5% as I guide you and bring you up to speed with all what I think you need to know to succeed...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It could be as easy as tagging your next project as &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/%23" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/%23" alt="#NEXT_IN_LINE"&gt;&lt;/a&gt; or &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/%23" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/%23" alt="#TAKE_OR_LEAVE_IT"&gt;&lt;/a&gt; or &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/%23" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/%23" alt="#CODE_CODE_PASS"&gt;&lt;/a&gt; ... &lt;/p&gt;

&lt;p&gt;Oh, by the way #CODE_CODE_PASS on &lt;a href="https://algebro.herokuapp.com/pages/about" rel="noopener noreferrer"&gt;https://algebro.herokuapp.com/pages/about&lt;/a&gt; &lt;a href="https://gitlab.com/etozzato/algebro" rel="noopener noreferrer"&gt;https://gitlab.com/etozzato/algebro&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
