<?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: Hasan Nadeem</title>
    <description>The latest articles on DEV Community by Hasan Nadeem (@hasannadeem).</description>
    <link>https://dev.to/hasannadeem</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%2F72098%2Facba3256-cf83-473f-a5d2-aba009468979.jpeg</url>
      <title>DEV Community: Hasan Nadeem</title>
      <link>https://dev.to/hasannadeem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hasannadeem"/>
    <language>en</language>
    <item>
      <title>Wanna clean dock on your Mac 🍎? Add spacers between irrelevant apps and clear the clutter!</title>
      <dc:creator>Hasan Nadeem</dc:creator>
      <pubDate>Wed, 27 Jul 2022 21:09:05 +0000</pubDate>
      <link>https://dev.to/hasanadeem/wanna-clean-dock-on-your-mac-add-spacers-between-irrelevant-apps-and-clear-the-clutter-7lh</link>
      <guid>https://dev.to/hasanadeem/wanna-clean-dock-on-your-mac-add-spacers-between-irrelevant-apps-and-clear-the-clutter-7lh</guid>
      <description>&lt;p&gt;You can add spacers(either small or default sized blank icon) between apps on your dock and put relevant apps together for quicker access. 💭&lt;/p&gt;

&lt;p&gt;Hit the following command on your favorite terminal and VOILA! 🎉🎉🎉&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="small-spacer-tile";}'; killall Dock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;the &lt;code&gt;killall Dock&lt;/code&gt; will kinda restart your dock and add small sized spacers on the most right side. You can drag those spacers wherever you want to on your dock.&lt;/p&gt;

&lt;p&gt;Instead of &lt;code&gt;small-spacer-tile&lt;/code&gt; you can try &lt;code&gt;spacer-tile&lt;/code&gt; in the aforementioned command and the default sized spacer will appear on the dock.&lt;/p&gt;

&lt;p&gt;You can remove the spacers pretty easily. Check the following screenshot.&lt;br&gt;
&lt;/p&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://ibb.co/4PLHWC8" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--yEX_XjZN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/2grTqRv/Screenshot-2022-07-28-at-1-48-50-AM.png" height="244" class="m-0" width="356"&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://ibb.co/4PLHWC8" rel="noopener noreferrer" class="c-link"&gt;
          Screenshot-2022-07-28-at-1-48-50-AM — ImgBB
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          Image Screenshot-2022-07-28-at-1-48-50-AM hosted in ImgBB
        &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://res.cloudinary.com/practicaldev/image/fetch/s--974unHVC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://simgbb.com/images/favicon.png" width="300" height="300"&gt;
        ibb.co
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Cheers! 🥂&lt;/p&gt;

</description>
      <category>macos</category>
      <category>utility</category>
      <category>productivity</category>
      <category>management</category>
    </item>
    <item>
      <title>Ruby/Rails Machine Setup Guide</title>
      <dc:creator>Hasan Nadeem</dc:creator>
      <pubDate>Wed, 13 Jan 2021 19:51:23 +0000</pubDate>
      <link>https://dev.to/hasannadeem/ruby-rails-machine-setup-guide-3l5a</link>
      <guid>https://dev.to/hasannadeem/ruby-rails-machine-setup-guide-3l5a</guid>
      <description>&lt;h2&gt;
  
  
  1- IDE
&lt;/h2&gt;

&lt;p&gt;We prefer to use &lt;code&gt;sublime&lt;/code&gt;/&lt;code&gt;VS Code&lt;/code&gt; for development(you can opt for any IDE though, but that will mean no support from seniors for any issues relating it and that might lead to un-neccessary time waste thats why it is highly preferred to not use any other IDEs). You are encouraged to use sublime or VSCode.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sublime:
&lt;/h3&gt;

&lt;p&gt;Install Sublime3 (google or &lt;a href="https://www.sublimetext.com/3"&gt;use this link&lt;/a&gt;)&lt;br&gt;
Here we will outline some basic configuration for sublime3 we usually use.&lt;/p&gt;

&lt;p&gt;i- &lt;strong&gt;Settings Tweaks&lt;/strong&gt;&lt;br&gt;
In sublime go to &lt;code&gt;preferences-&amp;gt;settings&lt;/code&gt; and place these in &lt;strong&gt;user settings&lt;/strong&gt; tab along with other settings.&lt;br&gt;
Don't mess with default settings tab&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "auto_complete_commit_on_tab": true,
    "auto_complete_triggers":
    [
        {
            "characters": "b4",
            "selector": "text.html"
        }
    ],
    "auto_indent": true,
    "caret_style": "phase",
    "color_scheme": "Packages/Color Scheme - Default/Monokai.sublime-color-scheme",
    "draw_minimap_border": true,
    "draw_white_space": "all",
    "enable_tab_scrolling": false,
    "ensure_newline_at_eof_on_save": true,
    "file_exclude_patterns":
    [
        "*.pyc",
        "*.pyo",
        "*.exe",
        "*.dll",
        "*.obj",
        "*.o",
        "*.a",
        "*.lib",
        "*.so",
        "*.dylib",
        "*.ncb",
        "*.sdf",
        "*.suo",
        "*.pdb",
        "*.idb",
        "*.class",
        "*.psd",
        "*.db",
        "*.beam",
        ".DS_Store",
        ".tags"
    ],
    "folder_exclude_patterns":
    [
        ".svn",
        ".git",
        ".hg",
        "CVS",
        ".sass-cache"
    ],
    "font_options":
    [
        "gray_antialias"
    ],
    "font_size": 15,
    "gutter": true,
    "highlight_line": true,
    "highlight_modified_tabs": true,
    "ignored_packages":
    [
        "CoffeeScriptHaml",
        "Emmet",
        "ESLint",
        "Markdown",
        "Ruby Completions",
        "SublimeLinter-contrib-eslint_d",
        "SublimeLinter-eslint",
        "Vintage"
    ],
    "line_numbers": true,
    "line_padding_top": 0,
    "mouse_wheel_switches_tabs": false,
    "overlay_scroll_bars": "enabled",
    "preview_on_click": true,
    "rulers":
    [
        120
    ],
    "scroll_past_end": false,
    "show_tab_close_buttons": false,
    "tab_size": 2,
    "theme": "Adaptive.sublime-theme",
    "translate_tabs_to_spaces": true,
    "trim_automatic_white_space": true,
    "trim_trailing_white_space_on_save": true,
    "use_tab_stops": true,
    "wide_caret": true,
    "word_separators": "./\\()\"'-:,.;&amp;lt;&amp;gt;@#$%^&amp;amp;*|+=[]{}`",
    "indent_using_spaces": true,
    "index_files": true,
    "line_padding_bottom": 2,
    "line_padding_top": 0,
    "rulers":
    [
        90,
        100,
        120
    ],
    "show_sidebar_on_save": false,
    "spell_check": true,
    "tab_width": 2,
    "word_wrap": false
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Have an eye for any redundency in settings and replace that if there is any.&lt;/p&gt;

&lt;p&gt;This will make indentation more easy, as indentation is one of the most important things for code quality and useability.&lt;/p&gt;

&lt;p&gt;ii- &lt;strong&gt;Sublime Package Control&lt;/strong&gt;&lt;br&gt;
Install package control following:&lt;br&gt;
&lt;a href="https://packagecontrol.io/installation"&gt;This link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After that, you can access package control in preferences and install any package you need(Like gitgutter, A file icon, beautifyruby, brackethighlighter etc).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here is the list of some handy packages in sublime, you can install them in some spare time. Not required but helpful for development.&lt;/em&gt;&lt;br&gt;
iii- &lt;strong&gt;Useful Sublime Packages:&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;A File Icon
All Autocomplete
Better CoffeeScript
Bootstrap 3 Autocomplete
BracketHighlighter
Cucumber Step Finder
Cucumber
Dockerfile Syntax Highlighting
Emmet
GitGutter
HTMLBeautify
Javascript Beautify
MarkdownEditing
Package Control
RecentActiveFiles
RSpec
RuboCop
Ruby Hash Converter
Ruby Slim
Sass
SassBeautify
SCSS
SideBarEnhancements
SublimeLinter-contrib-scss-lint
SublimeLinter-rubocop
YAML Nav
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  VSCode:
&lt;/h3&gt;

&lt;p&gt;Download and install VSCode from &lt;a href="https://code.visualstudio.com/download"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recommended settings for VSCode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    "ruby.useLanguageServer": true,
    "ruby.format": "rubocop",
    "ruby.intellisense": "rubyLocate",
    "ruby.useBundler": true,
    "ruby.rubocop.useBundler": true,
    "[ruby]": {
        "editor.defaultFormatter": "misogi.ruby-rubocop"
    },
    "editor.tabSize": 2,
    "files.insertFinalNewline": true,
    "telemetry.enableTelemetry": false,
    "window.titleBarStyle": "custom",
    "files.trimTrailingWhitespace": true,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add these settings in &lt;code&gt;File &amp;gt; Preferences &amp;gt; Settings&lt;/code&gt; (open the settings in json)&lt;/p&gt;

&lt;p&gt;Following are some recommended extension for VScode. Please run the following commands on terminal for installing the extensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;code --install-extension castwide.solargraph
code --install-extension dbaeumer.vscode-eslint
code --install-extension donjayamanne.githistory
code --install-extension eamodio.gitlens
code --install-extension HookyQR.beautify
code --install-extension IBM.output-colorizer
code --install-extension mhutchie.git-graph
code --install-extension misogi.ruby-rubocop
code --install-extension rebornix.ruby
code --install-extension wheredoesyourmindgo.gruvbox-concoctis
code --install-extension wingrunr21.vscode-ruby
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can install these through command line, one by one using the command: &lt;code&gt;code --install-extension $EXT_NAME&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2- Ruby environment/version manager with Rails Setup
&lt;/h2&gt;

&lt;p&gt;Link for &lt;a href="https://gorails.com/setup/ubuntu/20.04"&gt;Ruby/Rails/Rbenv/Postgres Setup&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Note: Please do the following while going through the above article.&lt;/strong&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Please install and use &lt;strong&gt;RBENV&lt;/strong&gt;. Skip &lt;strong&gt;RVM&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Please install &lt;strong&gt;Ruby version 2.6+ / Rails version 6 / Postgres version 11&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Please set the Postgres username to &lt;code&gt;postgres&lt;/code&gt; with password &lt;code&gt;postgres&lt;/code&gt; - &lt;strong&gt;MUST&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Please skip &lt;strong&gt;Configuring Git&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3- Database
&lt;/h2&gt;

&lt;p&gt;It is preferred to use &lt;strong&gt;postgresql&lt;/strong&gt; dbms for development, as it is a de-facto standard in most rails applications. Books may be using sqlite 3 but it is encouraged to use postgresql. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TIP:&lt;/strong&gt; If you keep an eye on what these commands actually are doing, that will be beneficial for you. Like you can give 2-4 mins on reading about &lt;strong&gt;apt-get&lt;/strong&gt; and what it actually does, give 2 minutes to read about &lt;strong&gt;sudo&lt;/strong&gt; or any new command like &lt;strong&gt;curl&lt;/strong&gt; if you don't know about it, this will help you &lt;strong&gt;grip ubuntu/linux quickly.&lt;/strong&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Terminal
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;For Fancy/Pretty Diff -&amp;gt; &lt;a href="https://github.com/so-fancy/diff-so-fancy"&gt;https://github.com/so-fancy/diff-so-fancy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For common git aliases, run the following commands on terminal:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;NOTE: Some parts of this guide are extracted from &lt;a href="https://gist.github.com/ziaulrehman40/16445c56e3f7bc7d1dece245fb61cf8e"&gt;https://gist.github.com/ziaulrehman40/16445c56e3f7bc7d1dece245fb61cf8e&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>vscode</category>
      <category>sublime</category>
    </item>
    <item>
      <title>rbenv: bundle: command not found</title>
      <dc:creator>Hasan Nadeem</dc:creator>
      <pubDate>Wed, 13 Jan 2021 19:49:03 +0000</pubDate>
      <link>https://dev.to/hasannadeem/rbenv-bundle-command-not-found-5agj</link>
      <guid>https://dev.to/hasannadeem/rbenv-bundle-command-not-found-5agj</guid>
      <description>&lt;p&gt;For those using RBENV for managing ruby versions, whenever you install a different ruby version and then you'll be faced with the following error(not 100% same lol):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbenv: bundle: command not found

The `bundle' command exists in these Ruby versions:
  2.3.3
  2.4.4
  2.5.7
  2.6.5
  2.7.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both these commands will be helpful in fixing the issue.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem update --system&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;



&lt;p&gt;&lt;code&gt;bundle update --bundler&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>rbenv</category>
      <category>ruby</category>
      <category>bundle</category>
      <category>bundler</category>
    </item>
    <item>
      <title>Running Rails Console Commands on Terminal</title>
      <dc:creator>Hasan Nadeem</dc:creator>
      <pubDate>Fri, 08 Jan 2021 12:32:13 +0000</pubDate>
      <link>https://dev.to/hasannadeem/running-rails-console-commands-on-terminal-2ma7</link>
      <guid>https://dev.to/hasannadeem/running-rails-console-commands-on-terminal-2ma7</guid>
      <description>&lt;p&gt;Wherever you are unable to run the rails console directly we can use something else. I found that to be helpful since I didn't have admin rights on the EC2 terminal but I had to play with rails console for Staging Environment &lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundle exec rails runner "_rails command_" -e $(ENVIRONMENT)&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;is that helpful command which helped me in running rails commands for the staging environment. We should definitely avoid using it as much as possible but there are scenarios where playing with rails console is our only choice.&lt;/p&gt;

&lt;p&gt;Example commands:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bundle exec rails runner "puts Cart.where(tenant_id: 3).destroy_all" -e staging&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>rails</category>
      <category>ruby</category>
      <category>linux</category>
      <category>ec2</category>
    </item>
  </channel>
</rss>
