<?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: jigarshah8055</title>
    <description>The latest articles on DEV Community by jigarshah8055 (@jigarshah8055).</description>
    <link>https://dev.to/jigarshah8055</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%2F286625%2Fa07d5429-4350-4f75-81d6-8dfb00734330.png</url>
      <title>DEV Community: jigarshah8055</title>
      <link>https://dev.to/jigarshah8055</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jigarshah8055"/>
    <language>en</language>
    <item>
      <title>Design Patterns : A Comprehensive Overview</title>
      <dc:creator>jigarshah8055</dc:creator>
      <pubDate>Tue, 20 Feb 2024 19:38:02 +0000</pubDate>
      <link>https://dev.to/jigarshah8055/design-patterns-a-comprehensive-overview-4ean</link>
      <guid>https://dev.to/jigarshah8055/design-patterns-a-comprehensive-overview-4ean</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;“Design patterns are essential tools in a software developer’s arsenal, offering proven solutions to recurring design challenges. In this comprehensive guide, we’ll explore the various types of design patterns and their applications in software development.”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxu41itmgcavoxp04dk83.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxu41itmgcavoxp04dk83.jpg" alt=":sighhhhh:" width="720" height="480"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I know, I know,&lt;/strong&gt;&lt;br&gt;
talking about design patterns can sometimes feel like diving into the deep end of the theoretical pool — enough to make even the most seasoned developer reach for a double-shot espresso. But fear not, fellow code wranglers! Let’s sprinkle some excitement into this journey through the land of design patterns, shall we?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvghc93ktg0b8dqpn2gsn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvghc93ktg0b8dqpn2gsn.jpg" alt=":yayyy:" width="720" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Even Design Patterns are Important?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Imagine you’re in the kitchen, trying to bake a cake for a special occasion. You’ve got all the ingredients laid out, but you’re missing one crucial thing: a recipe. Without a recipe, you’re left guessing at the measurements, mixing methods, and baking times. The result? A disaster waiting to happen.&lt;/p&gt;

&lt;p&gt;Now, think of design patterns as the recipes of the software development world. Just like a recipe guides you through the steps of baking a cake, design patterns provide tried-and-tested solutions to common problems in software design.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s why they’re so important:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: Just as following a recipe saves you time and effort in the kitchen, using design patterns saves developers time by providing pre-established solutions to recurring problems. Instead of reinventing the wheel every time, developers can rely on design patterns to streamline their workflow and produce high-quality code more efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Ever baked a cake without a recipe and ended up with a different result every time? Without design patterns, software development can feel like a guessing game, leading to inconsistent code quality and behavior. Design patterns promote consistency by providing standardized solutions that developers can follow, ensuring a uniform approach across the codebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: Imagine trying to bake a cake for a small family gathering and then suddenly having to cater to a large party. Without a scalable recipe, you’d be left scrambling to adjust the quantities and ingredients on the fly. Similarly, design patterns help software systems adapt to changing requirements and scale gracefully over time. By following established patterns, developers can build flexible and resilient codebases that can grow and evolve with the needs of the application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintainability&lt;/strong&gt;: Ever tried to decipher a handwritten recipe with scribbles and crossed-out instructions? Just like a messy recipe can make cooking a nightmare, poorly designed code can turn maintenance into a headache. Design patterns promote clean, modular, and maintainable code by separating concerns and organizing code logic in a logical and structured manner. This makes it easier for developers to understand, modify, and extend the codebase without introducing unintended side effects or breaking existing functionality.&lt;/p&gt;

&lt;p&gt;In essence, design patterns are like the secret ingredients that elevate your software development process from ordinary to extraordinary. By leveraging these proven solutions, developers can bake up software that’s efficient, consistent, scalable, and maintainable — just like a perfectly crafted cake that delights the taste buds and leaves everyone wanting more.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;What’s Coming Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3q74u1gyazihs383mt57.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3q74u1gyazihs383mt57.jpg" alt=":peek-a-booo:" width="720" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, let’s keep it simple and wait for my next blog on Design Patterns where I am going to describe the main three divisions of design patterns and what it stands for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shapes of Design Patterns&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Behavioural Patterns&lt;/li&gt;
&lt;li&gt;Creational Patterns&lt;/li&gt;
&lt;li&gt;Structural Patterns&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I know all of you guys are &lt;strong&gt;Readers/Developers/Tech Experts/Beginners&lt;/strong&gt; and mixed-up people who are very enthusiastic and have anyhow gone through these terminologies but I am going to make it much more relatable so before using it you don’t have to think contradictory that &lt;strong&gt;“My Code Is Working Fine!!! Why Do I Even Have To Follow This?”&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>designpatterns</category>
      <category>bestpractices</category>
      <category>ruby</category>
      <category>rails</category>
    </item>
    <item>
      <title>Password Protected Zip Using Ruby on Rails</title>
      <dc:creator>jigarshah8055</dc:creator>
      <pubDate>Tue, 20 Feb 2024 19:26:45 +0000</pubDate>
      <link>https://dev.to/jigarshah8055/password-protected-zip-using-ruby-on-rails-3a09</link>
      <guid>https://dev.to/jigarshah8055/password-protected-zip-using-ruby-on-rails-3a09</guid>
      <description>&lt;p&gt;This blog will guide you on how to create a Ruby on Rails application and add &lt;a href="https://github.com/rubyzip/rubyzip#rubyzip" rel="noopener noreferrer"&gt;rubyzip&lt;/a&gt; which used to make zip files with Password Protection.&lt;/p&gt;

&lt;p&gt;Let’s have a brief introduction about Password Protection using rubyzip. If you are familiar with rubyzip and Password Protection then directly go to Implementation section.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is rubyzip ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It’s a ruby gem (library) which is used to read and write zip files.&lt;/li&gt;
&lt;li&gt;rubyzip provide you the power of reading and writing zip files and also make password protected zip files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why rubyzip?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;rubyzip provides traditional password protection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ruby 1.9.2 or greater&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Technology Stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Technology: Ruby on Rails&lt;/li&gt;
&lt;li&gt;Versions: ruby 2.5.1p57 &amp;amp; rails 5.2.4&lt;/li&gt;
&lt;li&gt;Git Repository: &lt;a href="https://github.com/jigarshah8055/zipper" rel="noopener noreferrer"&gt;https://github.com/jigarshah8055/zipper&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&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%2Fmedia.tenor.com%2Fimages%2Fa677da5269f56fe4c3e7f8f09a74630e%2Ftenor.gif" 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%2Fmedia.tenor.com%2Fimages%2Fa677da5269f56fe4c3e7f8f09a74630e%2Ftenor.gif" alt="get started"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Create a new rails app&lt;/p&gt;

&lt;p&gt;&lt;code&gt; rails new zipper --database=postgresql &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now put gem in the gemfile as&lt;/p&gt;

&lt;p&gt;&lt;code&gt; gem 'rubyzip', '&amp;gt;= 1.0.0' &lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;em&gt;Don’t forget to bundle ;)&lt;/em&gt;
&lt;/h4&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate a controller with the create and new method&lt;/p&gt;

&lt;p&gt;&lt;code&gt; rails g controller zipping_folders new &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Simply set the root path to zipping_folders new method and make resource path for only create method in routes.rb&lt;/p&gt;

&lt;p&gt;&lt;code&gt; resources :zipping_folders, only: [:create] &lt;/code&gt;&lt;br&gt;
&lt;code&gt; root ‘zipping_folders#new’ &lt;/code&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now make a form in &lt;code&gt;new.html.erb&lt;/code&gt; with one file tag to choose files and two input fields which define zip file name and password respectively.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You have to write below code in &lt;code&gt;zipping_folders_controller.rb&lt;/code&gt;.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Bingooo!!! That's it..!!!
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Start your rails server and check it on localhost.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;You can find complete code on&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://github.com/jigarshah8055/zipper" rel="noopener noreferrer"&gt;https://github.com/jigarshah8055/zipper&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Overview To Mechanize</title>
      <dc:creator>jigarshah8055</dc:creator>
      <pubDate>Tue, 20 Feb 2024 19:26:18 +0000</pubDate>
      <link>https://dev.to/jigarshah8055/overview-to-mechanize-1jl9</link>
      <guid>https://dev.to/jigarshah8055/overview-to-mechanize-1jl9</guid>
      <description>&lt;p&gt;&lt;em&gt;This blog will guide you to the basic overview to use Mechanize using Ruby.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Mechanize?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/sparklemotion/mechanize"&gt;Mechanize&lt;/a&gt; is a ruby gem(library) which is used to makes automated web interactions easy.&lt;/li&gt;
&lt;li&gt; Mechanize is generally used for &lt;a href="https://en.wikipedia.org/wiki/Web_scraping"&gt;web scraping&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why Mechanize?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It automatically send and store cookies, follow redirections and submit forms by populating form fields.&lt;/li&gt;
&lt;li&gt;It also keeps tracks of visited sites as history.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4gR9qveX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://66.media.tumblr.com/07f721b85eae27fe7d877ab8a9b32cb6/tumblr_inline_n6zlr8IFqh1qbg2lu.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4gR9qveX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://66.media.tumblr.com/07f721b85eae27fe7d877ab8a9b32cb6/tumblr_inline_n6zlr8IFqh1qbg2lu.gif" alt="Shall we begin?" width="245" height="150"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here I'm giving example by making a simple html page which have links and a form&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First install the gem mechanize with below command.&lt;br&gt;
&lt;code&gt;gem install mechanize&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make a html page with some links and form by submitting that form you'll redirect to google home page.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Here there are two links where home will redirect you to the current page and contact link will redirect you to contact page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While you submit the given form by giving username then it'll go to &lt;a href="https://www.google.co.in/"&gt;google&lt;/a&gt; home page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now you have to make a ruby file and write below code in it.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This will give you the reference to basic operations like finding all links from web page, how to redirect to links, how to get form submit forms and how to get data of any web page.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;You can find more information about mechanize from below blogs.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://ruby.bastardsbook.com/chapters/mechanize/"&gt;http://ruby.bastardsbook.com/chapters/mechanize/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://readysteadycode.com/howto-scrape-websites-with-ruby-and-mechanize"&gt;https://readysteadycode.com/howto-scrape-websites-with-ruby-and-mechanize&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Complete Code On Github&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/jigarshah8055/mechanize"&gt;https://github.com/jigarshah8055/mechanize&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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