<?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: 웃</title>
    <description>The latest articles on DEV Community by 웃 (@gokucodes).</description>
    <link>https://dev.to/gokucodes</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%2F177151%2Fffd930f9-eb21-4211-ad1d-e32d2de32c8c.jpg</url>
      <title>DEV Community: 웃</title>
      <link>https://dev.to/gokucodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gokucodes"/>
    <language>en</language>
    <item>
      <title>Effortless K8s Namespace Switching Using Konfig</title>
      <dc:creator>웃</dc:creator>
      <pubDate>Mon, 16 Dec 2024 16:14:11 +0000</pubDate>
      <link>https://dev.to/gokucodes/easily-switch-k8s-namespaces-30pi</link>
      <guid>https://dev.to/gokucodes/easily-switch-k8s-namespaces-30pi</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Create a directory in the .kube folder:&lt;/strong&gt;&lt;br&gt;
  &lt;code&gt;❯ mkdir -p ~/.kube/configs&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Download all the config files and place them in the folder&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❯ cd ~/.kube/configs
❯ mv ~/Downloads/dev.yml .
❯ mv ~/Downloads/test.yml .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Install Konfig&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;❯ kubectl krew install konfig&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Use Konfig to merge all the configs into a single config file that Kubernetes uses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;❯ kubectl konfig merge ~/.kube/configs/* &amp;gt; ~/.kube/config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, you can easily switch between different environments using kubectx and kubens.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>development</category>
      <category>webdev</category>
      <category>containers</category>
    </item>
    <item>
      <title>Speed up your VSCode searches</title>
      <dc:creator>웃</dc:creator>
      <pubDate>Mon, 24 May 2021 14:32:38 +0000</pubDate>
      <link>https://dev.to/gokucodes/speed-up-your-vscode-searches-djn</link>
      <guid>https://dev.to/gokucodes/speed-up-your-vscode-searches-djn</guid>
      <description>&lt;p&gt;You can increase the speed at which you work with VSCode by limiting the folders that VSCode shows &amp;amp; searches. &lt;/p&gt;

&lt;h2&gt;
  
  
  Exclude Folders
&lt;/h2&gt;

&lt;p&gt;To exclude folders from showing up add the file globs you like(as shown in the example below)&lt;br&gt;
Open &lt;code&gt;Settings &amp;gt; Text Editor &amp;gt; Files &amp;gt; Files:Exclude&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Exclude files/folders from searching.
&lt;/h2&gt;

&lt;p&gt;Open &lt;code&gt;Settings &amp;gt; Text Editor &amp;gt; Features &amp;gt; Search &amp;gt; Search:Exclude&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Add as many path/file patterns as you want like for e.g.,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;**/node_modules
**/tmp
**.log
**/target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Refer: &lt;a href="https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options" rel="noopener noreferrer"&gt;https://code.visualstudio.com/docs/editor/codebasics#_advanced-search-options&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>editor</category>
      <category>speed</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Book of Five Rings - Miyamoto Musashi</title>
      <dc:creator>웃</dc:creator>
      <pubDate>Wed, 12 May 2021 16:57:50 +0000</pubDate>
      <link>https://dev.to/gokucodes/book-of-five-rings-miyamoto-musashi-4445</link>
      <guid>https://dev.to/gokucodes/book-of-five-rings-miyamoto-musashi-4445</guid>
      <description>&lt;p&gt;I have recently completed one of the great ancient books - &lt;strong&gt;The Book of Five Rings&lt;/strong&gt; by &lt;strong&gt;Miyamoto Musashi&lt;/strong&gt;. And thought that the book consists of ground rules that can be followed in any aspect of your life - career, personal etc. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Book of Ground&lt;/strong&gt;: Getting to know the groundwork is really important. Build your knowledge to lead &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Book of Water&lt;/strong&gt;: Water is clear and water gets the shape of its receptacle. You should be clear and be like water always.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Book of Fire&lt;/strong&gt;: The enthusiasm should be like fire always.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Book of Wind&lt;/strong&gt;: The strategy is to know what other schools are doing, studying old-traditions, traditions of the world. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Book of Void&lt;/strong&gt;: There is no start no ending. When you appreciate the nature and observe the things that are happening around you, you will naturally strike the opponent using those forces.&lt;/p&gt;

</description>
      <category>books</category>
      <category>summary</category>
      <category>career</category>
    </item>
    <item>
      <title>Uninstalling gems with a specific pattern/same family</title>
      <dc:creator>웃</dc:creator>
      <pubDate>Mon, 11 Jan 2021 19:58:27 +0000</pubDate>
      <link>https://dev.to/gokucodes/uninstalling-gems-with-a-specific-pattern-same-family-10b8</link>
      <guid>https://dev.to/gokucodes/uninstalling-gems-with-a-specific-pattern-same-family-10b8</guid>
      <description>&lt;p&gt;Ever wonderered how to uninstall same family of gems without uninstalling everything from your rubygems folder?&lt;/p&gt;

&lt;p&gt;I have mistakenly installed &lt;code&gt;aws-sdk&lt;/code&gt; gem when I all I needed was just &lt;code&gt;aws-sdk-s3&lt;/code&gt; gem but left the command to complete and after sometime to my horror there were 264 gems installed which correspond to every available AWS services!&lt;/p&gt;

&lt;p&gt;So, I wanted to remove all aws-sdk gems and startover again but at the same time didn't want to break my other gems. So I did write up small shellscript like the following:&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="nv"&gt;$ &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;x &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;gem list aws-sdk- &lt;span class="nt"&gt;--no-versions&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do &lt;/span&gt;gem uninstall &lt;span class="nv"&gt;$x&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; &lt;span class="nt"&gt;-x&lt;/span&gt; &lt;span class="nt"&gt;-I&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! All my 264 gems are uninstalled, not touching any other gem which is out of scope(&lt;em&gt;Thanks to AWS folks with their naming convention as their every gem starts with &lt;strong&gt;aws-sdk-&lt;/strong&gt; prefix.&lt;/em&gt;). &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>rubygems</category>
      <category>systems</category>
    </item>
    <item>
      <title>Migrating from sqlite3 to postgresql in Rails apps.</title>
      <dc:creator>웃</dc:creator>
      <pubDate>Sun, 20 Dec 2020 19:33:24 +0000</pubDate>
      <link>https://dev.to/gokucodes/migrating-from-sqlite3-to-postgresql-in-rails-apps-4enb</link>
      <guid>https://dev.to/gokucodes/migrating-from-sqlite3-to-postgresql-in-rails-apps-4enb</guid>
      <description>&lt;p&gt;Heroku for some reason doesn't support sqlite3 in their deployments. So, it is must to migrate your db from default sqlite3 to mysql or postgresql. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In order to do that you need to first add pg gem to your Gemfile file:&lt;br&gt;
&lt;code&gt;gem 'pg'&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then install the gem with bundle install.&lt;br&gt;
&lt;code&gt;bundle install&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;change database.yml file to use postgresql&lt;br&gt;
config/database.yml&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;development&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgresql&lt;/span&gt;
  &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_app_development&lt;/span&gt;
  &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
  &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5000&lt;/span&gt;
&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgresql&lt;/span&gt;
  &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_app_test&lt;/span&gt;
  &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
  &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5000&lt;/span&gt;

&lt;span class="na"&gt;production&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;adapter&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;postgresql&lt;/span&gt;
  &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my_app_production&lt;/span&gt;
  &lt;span class="na"&gt;pool&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;
  &lt;span class="na"&gt;timeout&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start postgres as service on your local machine: &lt;code&gt;brew services start postgresql&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now create the database by running &lt;code&gt;rake db:create&lt;/code&gt;&lt;br&gt;
this creates local db&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create the tables using the famous &lt;code&gt;rake db:migrate&lt;/code&gt; command.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you have seed data like I do, then do rake db:seed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;Sometimes the postgresql that's on your machine might be old one and so it becomes problematic to run postgresql service and create local database that your development env is trying to connect to. If that's the case then you need to update your postgres version&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Update postgresql
&lt;code&gt;brew postgresql-upgrade-database&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Restart postgres service
&lt;code&gt;brew services restart postgresql&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Go to your apps root &amp;amp; create the database in postgresql
&lt;code&gt;rails db:create&lt;/code&gt;
This will create a new &lt;code&gt;my_app_development&lt;/code&gt; db in your local postgres instance&lt;/li&gt;
&lt;li&gt;Now the usual steps follow like migrating db &amp;amp; seeding data if you have any.
&lt;code&gt;rails db:migrate&lt;/code&gt;
&lt;code&gt;rails db:seed&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>rails</category>
      <category>postgres</category>
      <category>sqlite3</category>
      <category>heroku</category>
    </item>
    <item>
      <title>Adding Custom fonts to Rails6 using webpacker</title>
      <dc:creator>웃</dc:creator>
      <pubDate>Mon, 14 Dec 2020 22:50:45 +0000</pubDate>
      <link>https://dev.to/gokucodes/adding-custom-fonts-to-rails6-using-webpacker-d51</link>
      <guid>https://dev.to/gokucodes/adding-custom-fonts-to-rails6-using-webpacker-d51</guid>
      <description>&lt;p&gt;Adding custom fonts to you application stands out and makes a statement. In this article I would like to tell how to import custom fonts into your Rails 6 Application with Webpacker.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download the font from remote location.&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;fonts&lt;/code&gt; folder in the path app/javascript/ folder. &lt;/li&gt;
&lt;li&gt;Create a SASS file fonts.scss and specify location of your font, add import from external urls as well. - I prefer using seperate file for importing all my fonts&lt;/li&gt;
&lt;/ol&gt;

&lt;h6&gt;
  
  
  app/javascript/stylesheets/fonts/fonts.scss
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sass"&gt;&lt;code&gt;  &lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s"&gt;url('../fonts/harringt.ttf')&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Specify the font family in your application.css or specific views of a controller.&lt;/p&gt;

&lt;h6&gt;
  
  
  app/javascript/stylesheets/pages.css
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.page-titles&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;'Harrington'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;cursive&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, add CSS class to to sections you want to display in particular font or whole body.&lt;/p&gt;

&lt;h6&gt;
  
  
  app/views/pages/index.html.erb
&lt;/h6&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- pages/index.html.erb --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"page-titles"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Custom Font&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thats it! You have embedded custom fonts into your Rails application.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks to &lt;a href="https://fontmeme.com/" rel="noopener noreferrer"&gt;Font Meme&lt;/a&gt; for &lt;a href="https://fontmeme.com/fonts/harrington-font/#previewtool" rel="noopener noreferrer"&gt;Harrington&lt;/a&gt; font.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webpack</category>
      <category>font</category>
      <category>rails</category>
      <category>ruby</category>
    </item>
  </channel>
</rss>
