<?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>Forem: chair</title>
    <description>The latest articles on Forem by chair (@chair).</description>
    <link>https://forem.com/chair</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%2F278812%2F16154f66-6731-4c76-9fdf-6ddbde11f381.png</url>
      <title>Forem: chair</title>
      <link>https://forem.com/chair</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/chair"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Tue, 16 Sep 2025 23:32:00 +0000</pubDate>
      <link>https://forem.com/chair/-3226</link>
      <guid>https://forem.com/chair/-3226</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://dev.to/laniyanabdulqawi/why-whisper-failed-and-how-waku-is-building-the-future-of-web3-communication-52g0" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijzh2kn60t2zna198lkp.png" height="auto" class="m-0"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://dev.to/laniyanabdulqawi/why-whisper-failed-and-how-waku-is-building-the-future-of-web3-communication-52g0" rel="noopener noreferrer" class="c-link"&gt;
            Why Whisper Failed and How Waku is Building the Future of Web3 Communication - DEV Community
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Blockchain technology is powerful, but it doesn’t inherently guarantee privacy. It offers...
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j7kvp660rqzt99zui8e.png"&gt;
          dev.to
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>web3</category>
      <category>blockchain</category>
      <category>tutorial</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Common Gatsby Plugins Configuration Cheatsheet</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Mon, 09 Aug 2021 01:27:26 +0000</pubDate>
      <link>https://forem.com/chair/common-gatsby-plugins-configuration-cheatsheet-1ik9</link>
      <guid>https://forem.com/chair/common-gatsby-plugins-configuration-cheatsheet-1ik9</guid>
      <description>&lt;p&gt;Follow the checklist, run the commands and update the &lt;code&gt;gatsby-config.js&lt;/code&gt; file with the corresponding plugin data.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gatsbyjs.com/docs"&gt;Gatsby Docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Plugins Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;gatsby-background-image
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add gatsby-background-image

plugins: [`gatsby-transformer-sharp`, `gatsby-plugin-sharp`]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;gbimage-bridge
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add gbimage-bridge

relies on dependencies from gatsby-background-image, no plugins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/docs/how-to/styling/bulma/"&gt;https://www.gatsbyjs.com/docs/how-to/styling/bulma/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add bulma sass gatsby-plugin-sass

plugins: [`gatsby-plugin-sass`],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-react-helmet/"&gt;gatsby-plugin-react-helmet&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gatsby-plugin-react-helmet react-helmet

plugins: [`gatsby-plugin-react-helmet`]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-source-filesystem/"&gt;gatsby-source-filesystem&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gatsby-source-filesystem

plugins: [
    // You can have multiple instances of this plugin
    // to read source nodes from different locations on your
    // filesystem.
    //
    // The following sets up the Jekyll pattern of having a
    // "pages" directory for Markdown files and a "data" directory
    // for `.json`, `.yaml`, `.csv`.
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `pages`,
        path: `${__dirname}/src/pages/`,
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `data`,
        path: `${__dirname}/src/data/`,
        ignore: [`**/\.*`], // ignore files starting with a dot
      },
    },
  ],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-transformer-sharp/"&gt;gatsby-transformer-sharp&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gatsby-transformer-sharp gatsby-plugin-sharp

plugins: [`gatsby-plugin-sharp`, `gatsby-transformer-sharp`],

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-sass/"&gt;gatsby-plugin-sass&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install sass gatsby-plugin-sass

plugins: [`gatsby-plugin-sass`]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;[ ] &lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-web-font-loader/"&gt;gatsby-plugin-web-font-loader&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add gatsby-plugin-web-font-loader

plugins: [
    {
      resolve: 'gatsby-plugin-web-font-loader',
      options: {
        google: {
          families: ['Droid Sans', 'Droid Serif']
        }
      }
    }
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-gdpr-cookies/"&gt;gatsby-plugin-gdpr-cookies&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add gatsby-plugin-gdpr-cookies or npm install --save gatsby-plugin-gdpr-cookies

plugins: [
    {
      resolve: `gatsby-plugin-gdpr-cookies`,
      options: {
        googleAnalytics: {
          trackingId: 'YOUR_GOOGLE_ANALYTICS_TRACKING_ID', // leave empty if you want to disable the tracker
          cookieName: 'gatsby-gdpr-google-analytics', // default
          anonymize: true, // default
          allowAdFeatures: false // default
        },
        googleTagManager: {
          trackingId: 'YOUR_GOOGLE_TAG_MANAGER_TRACKING_ID', // leave empty if you want to disable the tracker
          cookieName: 'gatsby-gdpr-google-tagmanager', // default
          dataLayerName: 'dataLayer', // default
        },
        facebookPixel: {
          pixelId: 'YOUR_FACEBOOK_PIXEL_ID', // leave empty if you want to disable the tracker
          cookieName: 'gatsby-gdpr-facebook-pixel', // default
        },
        tikTokPixel: {
          pixelId: 'YOUR_TIKTOK_PIXEL_ID', // leave empty if you want to disable the tracker
          cookieName: 'gatsby-gdpr-tiktok-pixel', // default
        },
        hotjar: {
          hjid: 'YOUR_HOTJAR_ID',
          hjsv: 'YOUR_HOTJAR_SNIPPET_VERSION',
          cookieName: 'gatsby-gdpr-hotjar', // default
        },
        // defines the environments where the tracking should be available  - default is ["production"]
        environments: ['production', 'development']
      },
    },
  ],

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-manifest/"&gt;gatsby-plugin-manifest&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gatsby-plugin-manifest

plugins: [
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `GatsbyJS`,
        short_name: `GatsbyJS`,
        start_url: `/`,
        background_color: `#f7f0eb`,
        theme_color: `#a2466c`,
        display: `standalone`,
      },
    },
  ],

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-alias-imports/"&gt;gatsby-plugin-alias-imports&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add gatsby-plugin-alias-imports


plugins: [
    {
      resolve: `gatsby-plugin-alias-imports`,
      options: {
        alias: {},
        extensions: []
      }
    }
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>gatsby</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Ruby Descending Order Method</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Tue, 11 Aug 2020 04:23:19 +0000</pubDate>
      <link>https://forem.com/chair/ruby-descending-order-method-4nac</link>
      <guid>https://forem.com/chair/ruby-descending-order-method-4nac</guid>
      <description>&lt;p&gt;Method takes a non-negative integer (n) as an argument then:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;turns it into a string&lt;/li&gt;
&lt;li&gt;splits each character in the string into an array of strings &lt;/li&gt;
&lt;li&gt;sorts the array alphabetically &lt;/li&gt;
&lt;li&gt;joins the strings together in ascending order &lt;/li&gt;
&lt;li&gt;reverses the string and turns it back into an integer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know if you found a better way!&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;descending_order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;sort_by&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ruby</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Screen commands</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Sun, 31 May 2020 00:26:53 +0000</pubDate>
      <link>https://forem.com/chair/screen-commands-115</link>
      <guid>https://forem.com/chair/screen-commands-115</guid>
      <description>&lt;p&gt;Screen is useful for running long scripts on linux virtual machines where you don't want to risk termination due to a disconnection.&lt;/p&gt;

&lt;p&gt;The following commands are all you will ever need, probably. Most of the time.&lt;/p&gt;

&lt;p&gt;download: &lt;code&gt;sudo yum install screen&lt;/code&gt;&lt;br&gt;
list sessions: &lt;code&gt;screen -ls&lt;/code&gt;&lt;br&gt;
start session: &lt;code&gt;screen&lt;/code&gt;&lt;br&gt;
detach from session: &lt;code&gt;ctrl a + d&lt;/code&gt;&lt;br&gt;
re-attach: if there is only one session running you can do &lt;code&gt;screen -r&lt;/code&gt; else do &lt;code&gt;screen -ls&lt;/code&gt; and get the desired session id and do &lt;code&gt;screen -r &amp;lt;SESSION_ID&amp;gt;&lt;/code&gt;&lt;br&gt;
kill session from inside the session: &lt;code&gt;ctrl a + k + y&lt;/code&gt;&lt;br&gt;
enable vertical scrolling: &lt;code&gt;ctrl a + ESC&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A lovely cheatsheet I forked from someone wiser than I, who also forked it from someone before them:&lt;br&gt;
&lt;a href="https://gist.github.com/aarobender/a503231e83b862c3757ab6527bdfc812"&gt;https://gist.github.com/aarobender/a503231e83b862c3757ab6527bdfc812&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Ruby progressbar template</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Tue, 28 Apr 2020 17:32:00 +0000</pubDate>
      <link>https://forem.com/chair/ruby-progressbar-template-2mo4</link>
      <guid>https://forem.com/chair/ruby-progressbar-template-2mo4</guid>
      <description>&lt;p&gt;Use this template for your progressbar needs in ruby. Highly modifiable, always useful, easy to forget. The Ruby progressbar is...a tool you can use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Up top in your file, require the &lt;code&gt;ruby-progressbar&lt;/code&gt; gem&lt;/li&gt;
&lt;li&gt;Construct a query worth tracking the progress of&lt;/li&gt;
&lt;li&gt;Use the progressbar template below&lt;/li&gt;
&lt;li&gt;Enjoy peace of mind knowing exactly how long your process will take&lt;/li&gt;
&lt;li&gt;Modify the code below to fit your use case
&lt;/li&gt;
&lt;/ul&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;'ruby-progressbar'&lt;/span&gt;

&lt;span class="n"&gt;query&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Person&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="nf"&gt;not&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;last_name: &lt;/span&gt;&lt;span class="s2"&gt;"Bigalow"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;progress&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ProgressBar&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="ss"&gt;total: &lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;format: &lt;/span&gt;&lt;span class="s2"&gt;"Progress: %a &amp;lt;%B&amp;gt; %p%% %t"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="ss"&gt;smoothing: &lt;/span&gt;&lt;span class="mf"&gt;0.5&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find_each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
 &lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;increment&lt;/span&gt;

 &lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;first_name: &lt;/span&gt;&lt;span class="s2"&gt;"Duece"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ruby</category>
      <category>rails</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Git flow multiple hotfix branches</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Tue, 21 Apr 2020 12:49:10 +0000</pubDate>
      <link>https://forem.com/chair/open-multiple-hotfix-branches-with-git-flow-4k4j</link>
      <guid>https://forem.com/chair/open-multiple-hotfix-branches-with-git-flow-4k4j</guid>
      <description>&lt;p&gt;Adjust your git config to allow for multiple concurrent hotfix branches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config gitflow.multi-hotfix &lt;span class="nb"&gt;true
&lt;/span&gt;git config &lt;span class="nt"&gt;--get&lt;/span&gt; gitflow.multi-hotfix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You don't have to rename that second hotfix branch to &lt;code&gt;slowfix&lt;/code&gt; before pushing ever again.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Translate rails query to raw sql in rails console</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Mon, 20 Apr 2020 12:48:35 +0000</pubDate>
      <link>https://forem.com/chair/translate-rails-query-to-raw-sql-p50</link>
      <guid>https://forem.com/chair/translate-rails-query-to-raw-sql-p50</guid>
      <description>&lt;p&gt;Gone are the days of wondering what the sql equivalent of your rails query might be!&lt;/p&gt;

&lt;p&gt;In the rails console first run:&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="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDOUT&lt;/span&gt;&lt;span class="p"&gt;)&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 ruby"&gt;&lt;code&gt;&lt;span class="no"&gt;ActiveRecord&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;instance_variable_set&lt;/span&gt; &lt;span class="ss"&gt;:@logger&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;STDOUT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thats it! Thats all!&lt;/p&gt;

&lt;p&gt;Have fun be safe.&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>sql</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Find large files on Linux OS</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Sat, 04 Apr 2020 21:50:22 +0000</pubDate>
      <link>https://forem.com/chair/find-large-files-in-aws-ec2-1d0i</link>
      <guid>https://forem.com/chair/find-large-files-in-aws-ec2-1d0i</guid>
      <description>&lt;p&gt;If you work with Linux VM's, you know it can be a pain to find some deeply hidden large files sucking away at your storage. Fear not, use &lt;code&gt;du&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo du -shx /* | sort -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will return 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;...
4K  /opt
72K /root
764K    /run
29M /etc
39M /boot
256M    /home
889M    /usr
33G /var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Looks like our &lt;code&gt;/var&lt;/code&gt; folder could use some further inspection, lets adjust our command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo du -shx /var/* | sort -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we 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;...
60K /var/spool
224M    /var/cache
6.2G    /var/log
27G /var/lib
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It appears we have two more directories worthy of further digging.&lt;/p&gt;

&lt;p&gt;We can adjust our command again to inspect &lt;code&gt;/var/lib/*&lt;/code&gt; or &lt;code&gt;/var/log/*&lt;/code&gt; respectively.&lt;/p&gt;

&lt;p&gt;Good luck!&lt;/p&gt;

</description>
      <category>linux</category>
      <category>docker</category>
      <category>aws</category>
    </item>
    <item>
      <title>CSV on Rails</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Mon, 16 Mar 2020 02:00:39 +0000</pubDate>
      <link>https://forem.com/chair/csv-on-rails-53pk</link>
      <guid>https://forem.com/chair/csv-on-rails-53pk</guid>
      <description>&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=3nUCUuJgMW4"&gt;Video Guide on YouTube&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using csv's you can quickly jumpstart your rails app with mock data and help you hit the ground running in your development process.&lt;/p&gt;

&lt;p&gt;This post will teach you how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Spin up a new rails app with postgresql database.&lt;/li&gt;
&lt;li&gt;Create a mock data csv with help from our friends at mockaroo &lt;a href="https://mockaroo.com/"&gt;https://mockaroo.com/&lt;/a&gt; we'll be using car makes and models for this demo.&lt;/li&gt;
&lt;li&gt;Create database records from our mock data in our rails app using the ruby CSV class.&lt;/li&gt;
&lt;li&gt;Export specific database objects to CSV.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Resource Links:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://mockaroo.com/"&gt;Mockaroo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/bighappytrees/acaa7c8f8a71dc663194ce79c44d00b9"&gt;New rails app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ruby-doc.org/stdlib-2.4.1/libdoc/csv/rdoc/CSV.html"&gt;Ruby CSV Class&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Lets get going!
&lt;/h4&gt;

&lt;p&gt;First lets spin up our new rails app:&lt;br&gt;
&lt;code&gt;rails new my_car_app --database=postgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;cd into your app's directpry and run &lt;code&gt;bundle&lt;/code&gt; to ensure all our gems are loaded:&lt;br&gt;
&lt;code&gt;bundle&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Next lets scaffold a new car model with all the accouterments:&lt;br&gt;
&lt;code&gt;rails generate scaffold Car make:string model:string model_year:integer factory_id:string&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Setup and migrate your database:&lt;br&gt;
&lt;code&gt;rails db:setup&lt;/code&gt;&lt;br&gt;
then&lt;br&gt;
&lt;code&gt;rails db:migrate&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Hop into the rails console, from the home directory of your app run:&lt;br&gt;
&lt;code&gt;rails console&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run a count on the car model to prove there are indeed, 0 cars:&lt;br&gt;
&lt;code&gt;Car.count&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lets create a car using the "create" method defined in our cars controller:&lt;br&gt;
&lt;code&gt;Car.create!&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Awesome! We have a car. It is a bit bland though, not much data to be had apart from nil values for the interesting bits.&lt;/p&gt;

&lt;p&gt;This is where mockaroo helps us out! Hope over to &lt;a href="https://mockaroo.com"&gt;https://mockaroo.com&lt;/a&gt; and create the fields like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jktPYtOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/es7aklq3jdxwyxxl6t51.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jktPYtOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/es7aklq3jdxwyxxl6t51.png" alt="Mockaroo Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Place the mock data csv file with the mock data in the &lt;code&gt;app/tmp/&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Now lets create a new file in your app's home directory named &lt;code&gt;create_cars.rb&lt;/code&gt;.&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;'csv'&lt;/span&gt;

&lt;span class="no"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"tmp/car_mock_data.csv"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="no"&gt;Car&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="ss"&gt;make: &lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="ss"&gt;model: &lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="ss"&gt;model_year: &lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="ss"&gt;factory_id: &lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;We are now prepared to create 1000 new cars! In your bash terminal from your app's home directory run:&lt;br&gt;
&lt;code&gt;rails r create_cars.rb&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Hop back into your rails console:&lt;br&gt;
&lt;code&gt;rails c&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Confirm we we have 1001 cars now:&lt;br&gt;
&lt;code&gt;Car.count&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, lets say we would like to create a csv containing only Japanese made car models?&lt;/p&gt;

&lt;p&gt;Lets create another file in our app's home directory, called &lt;code&gt;japanese_cars.rb&lt;/code&gt;.&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;'csv'&lt;/span&gt;

&lt;span class="n"&gt;japanese_car_makes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="s2"&gt;"Toyota"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Suzuki"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Nissan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Infiniti"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Mazda"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Lexus"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Mitsubishi"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Isuzu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Subaru"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Acura"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Honda"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;"Scion"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'tmp/japanese_cars.csv'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="no"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"wb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="c1"&gt;# headers&lt;/span&gt;
  &lt;span class="n"&gt;csv&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Make"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Model"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Year"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Facory ID"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

  &lt;span class="no"&gt;Car&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;make: &lt;/span&gt;&lt;span class="n"&gt;japanese_car_makes&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;find_each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="k"&gt;begin&lt;/span&gt;
      &lt;span class="c1"&gt;# data rows&lt;/span&gt;
      &lt;span class="n"&gt;csv&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;make&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;model_year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;factory_id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;rescue&lt;/span&gt; &lt;span class="no"&gt;Exception&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;
      &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backtrace_cleaner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;clean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;backtrace&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Up top we require the ruby &lt;code&gt;csv&lt;/code&gt; class.&lt;/li&gt;
&lt;li&gt;Declare an array of Japanese car model names&lt;/li&gt;
&lt;li&gt;Set a path variable for your csv&lt;/li&gt;
&lt;li&gt;Begin the csv loop&lt;/li&gt;
&lt;li&gt;Loop thru cars where the make matches one of the &lt;code&gt;japanese_car_makes&lt;/code&gt; indexes.&lt;/li&gt;
&lt;li&gt;Set the headers&lt;/li&gt;
&lt;li&gt;Fill in the data rows&lt;/li&gt;
&lt;li&gt;Handle errors gracefully&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And voila! We've covered quite a bit in such a short and easy exercise!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The ruby csv class&lt;/li&gt;
&lt;li&gt;Spin up a new rails app&lt;/li&gt;
&lt;li&gt;Scaffold a new model, and all accouterments&lt;/li&gt;
&lt;li&gt;Create database entries from a csv file&lt;/li&gt;
&lt;li&gt;Create a csv file from specific database entries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Good luck, have fun!&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Ruby CSV Template</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Sun, 15 Mar 2020 20:37:57 +0000</pubDate>
      <link>https://forem.com/chair/ruby-csv-template-4cg9</link>
      <guid>https://forem.com/chair/ruby-csv-template-4cg9</guid>
      <description>&lt;p&gt;I refer to this #ruby #csv template at least once a week in my day job. I hope this will also become useful for you!&lt;/p&gt;

&lt;p&gt;This template simply loops thru an assumptive group of users in a database. The template can be easily modified for your own use.&lt;/p&gt;

&lt;p&gt;Simply modify the desired file path, the objects you would like to loop thru, and execute the following command from the the root directory of your rails app: &lt;code&gt;rails r &amp;lt;name_of_template&amp;gt;&lt;/code&gt;&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;'csv'&lt;/span&gt;

&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'file_path.csv'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;User&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;order&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;created_at: :desc&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="no"&gt;CSV&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"wb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
  &lt;span class="c1"&gt;# headers&lt;/span&gt;
  &lt;span class="n"&gt;csv&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'First Name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Last Name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Date of Birth'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

  &lt;span class="c1"&gt;# loop thru users&lt;/span&gt;
  &lt;span class="n"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;csv&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;last_name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;date_of_birth&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;  
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>ruby</category>
      <category>rails</category>
      <category>csv</category>
    </item>
    <item>
      <title>New rails 6 app with postgresql database and heroku deployment</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Sun, 01 Dec 2019 23:40:06 +0000</pubDate>
      <link>https://forem.com/chair/quick-guide-new-rails-6-app-with-postgresql-database-and-heroku-deployment-7ji</link>
      <guid>https://forem.com/chair/quick-guide-new-rails-6-app-with-postgresql-database-and-heroku-deployment-7ji</guid>
      <description>&lt;p&gt;I have been working with rails professionally for over a year now, and I want to share the guide I use personally to quickly spin up a new rails app with a postgresql database, and deploy to heroku.&lt;/p&gt;

&lt;p&gt;My aim is to make it quick and easy for you to get going, and take the fuzziness out of the setup process.&lt;/p&gt;

&lt;p&gt;Find my gist here!&lt;br&gt;
&lt;a href="https://gist.github.com/chair28980/acaa7c8f8a71dc663194ce79c44d00b9"&gt;https://gist.github.com/chair28980/acaa7c8f8a71dc663194ce79c44d00b9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback. Drop a comment here or find me on twitter: @vrycmfy&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>postgres</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Restart all running docker containers</title>
      <dc:creator>chair</dc:creator>
      <pubDate>Fri, 29 Nov 2019 20:13:49 +0000</pubDate>
      <link>https://forem.com/chair/restart-all-running-docker-containers-4d1j</link>
      <guid>https://forem.com/chair/restart-all-running-docker-containers-4d1j</guid>
      <description>&lt;p&gt;Save yourself the hassle of restarting your containers individually.&lt;/p&gt;

&lt;p&gt;First see which containers are currently running:&lt;br&gt;
&lt;code&gt;docker ps&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To restart an individual container you can run:&lt;br&gt;
&lt;code&gt;docker restart &amp;lt;container id&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It can be useful to feed the output of a docker command into another to save the effort and time of running the above, if you know you want to restart all the containers.&lt;/p&gt;

&lt;p&gt;Restart all running containers:&lt;br&gt;
&lt;code&gt;docker restart $(docker ps -q)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Happy dockering!&lt;/p&gt;

</description>
      <category>docker</category>
      <category>todayilearned</category>
    </item>
  </channel>
</rss>
