<?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: Hadi Houssainy</title>
    <description>The latest articles on DEV Community by Hadi Houssainy (@0had0).</description>
    <link>https://dev.to/0had0</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%2F298493%2Fa686f721-c911-4c39-841a-5b9d1e4aa0e4.jpeg</url>
      <title>DEV Community: Hadi Houssainy</title>
      <link>https://dev.to/0had0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0had0"/>
    <language>en</language>
    <item>
      <title>Color 2 Areas underlines in Recharts without mixing colors caused by the Opacity</title>
      <dc:creator>Hadi Houssainy</dc:creator>
      <pubDate>Tue, 07 Sep 2021 10:17:51 +0000</pubDate>
      <link>https://dev.to/0had0/color-2-areas-underlines-in-recharts-without-mixing-colors-caused-by-the-opacity-1ele</link>
      <guid>https://dev.to/0had0/color-2-areas-underlines-in-recharts-without-mixing-colors-caused-by-the-opacity-1ele</guid>
      <description>&lt;p&gt;This is how to separate the charts areas color when dealing with &lt;code&gt;recharts&lt;/code&gt;, &lt;/p&gt;

&lt;p&gt;I'm using react with &lt;code&gt;material-ui&lt;/code&gt; theme ( the useTheme line 🙄 )&lt;/p&gt;

&lt;p&gt;U need to create 3 areas for the 2 lines,&lt;br&gt;
this method work only when u know that 1 line is always on top&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function RevenueChart({ data }: RevenueChartProps) {
  const theme = useTheme();
  return (
    &amp;lt;div style={{ height: 300, width: '100%' }}&amp;gt;
      &amp;lt;ResponsiveContainer&amp;gt;
        &amp;lt;AreaChart
          width={730}
          height={250}
          data={data}
          margin={{ top: 10, right: 30, left: 0, bottom: 0 }}
        &amp;gt;
          &amp;lt;XAxis dataKey="name" tick={{ fill: theme.palette.text.hint }} /&amp;gt;
          &amp;lt;YAxis tick={{ fill: theme.palette.text.hint }} /&amp;gt;
          &amp;lt;CartesianGrid strokeDasharray="3 3" /&amp;gt;
          &amp;lt;Area
            activeDot={false}
            dot={false}
            strokeWidth={0}
            type="monotone"
            dataKey="diff"
            stroke={theme.palette.primary.main}
            fillOpacity={0.6}
            fill={lighten(theme.palette.primary.main, 0.2)}
          /&amp;gt;
          &amp;lt;Area
            activeDot={{ r: 8, fill: theme.palette.primary.main }}
            strokeWidth={2}
            type="monotone"
            dataKey="incomes"
            stroke={theme.palette.primary.main}
            fillOpacity={0}
            dot
          /&amp;gt;
          &amp;lt;Area
            activeDot={{ r: 8, fill: '#ea6b78' }}
            strokeWidth={2}
            type="monotone"
            dataKey="outcomes"
            stroke="#ea6b78"
            fillOpacity={0.6}
            fill={lighten('#ea6b78', 0.2)}
            dot
          /&amp;gt;
          &amp;lt;Tooltip content={&amp;lt;CustomContent /&amp;gt;} /&amp;gt;
        &amp;lt;/AreaChart&amp;gt;
      &amp;lt;/ResponsiveContainer&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the data prop has the form of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type data = {
  incomes: Array&amp;lt;Numbers&amp;gt;,
  outcomes: Array&amp;lt;Numbers&amp;gt;,
  diff: Array&amp;lt;Array&amp;lt;Number, Number&amp;gt;&amp;gt;,
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the incomes &amp;amp; outcomes are clearly just your data,&lt;br&gt;
the diff is an array of arrays, the &lt;code&gt;ith&lt;/code&gt; inner array is formed by &lt;code&gt;[ incomes[i], outcomes[i] ]&lt;/code&gt; as u can see incomes is on top so it's the start point &amp;amp; outcomes is in the bottom, the end.&lt;/p&gt;

&lt;p&gt;the components are created in this form:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Area
    ...
    strokeWidth={2}
    dataKey="diff"
    fillOpacity={0.6}
    fill={lighten(theme.palette.primary.main, 0.2)}
    ...
    /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the colored area between the lines has no stroke (strokeWidth = 0) but has a fill color (opacity != 0),&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Area
    ...
    strokeWidth={2}
    dataKey="diff"
    fillOpacity={0}
    ...
    /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the top line have no fill color (opacity = 0) but have stroke (strokeWidth != 0),&lt;/p&gt;

&lt;p&gt;and the bottom line can have both&lt;/p&gt;

&lt;p&gt;The main idea is that &lt;code&gt;Area&lt;/code&gt; component can take data as an array of start &amp;amp; end limits&lt;/p&gt;

</description>
      <category>recharts</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Reboot Windows Shortcut</title>
      <dc:creator>Hadi Houssainy</dc:creator>
      <pubDate>Sat, 28 Aug 2021 08:58:41 +0000</pubDate>
      <link>https://dev.to/0had0/reboot-windows-shortcut-1b20</link>
      <guid>https://dev.to/0had0/reboot-windows-shortcut-1b20</guid>
      <description>&lt;p&gt;Hello,&lt;br&gt;
this is my first post here,&lt;br&gt;
I have Arch Linux installed with windows 10 dual boot &amp;amp; systemd-boot as bootloader&lt;/p&gt;

&lt;p&gt;so first u need to check your boot entries:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bootctl list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oh6V2LqT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3z5svmjpjgn0y2zihoka.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oh6V2LqT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3z5svmjpjgn0y2zihoka.png" alt="image" width="880" height="285"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;remember the windows id in the output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;then create a new file anywhere in your machine&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd &amp;amp; touch reboot-windows.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add the following code inside the new file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/sh
systemctl reboot --boot-loader-entry=auto-windows
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;here &lt;code&gt;--boot-loader-entry=&amp;lt;your windows id&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;launch the script and you will escape to windows!&lt;br&gt;
&lt;a href="https://i.giphy.com/media/3o6gDUY3B8ocAgMNhu/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/3o6gDUY3B8ocAgMNhu/giphy.gif" alt="escape to windows" width="480" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>windows</category>
      <category>archlinux</category>
      <category>systemd</category>
      <category>dualboot</category>
    </item>
  </channel>
</rss>
