Articles

A collection of thoughts, inspiration, mistakes, and other long-form minutia I've written. For smaller, more regular tidbits — peruse the notes section.

Browse by topic

Run RuboCop on git commit with Overcommit Gem

Published by Prabin Poudel 6 min read
cover: Run RuboCop on git commit with Overcommit Gem
How do you make sure every member in your team follows best coding practices and never commits code with issues to remote repository? Answer is overcommit gem and git hooks. You can configure overcommit gem to run RuboCop on modified codes before committing those code to git

Beginner's Guide to RuboCop in Rails

Published by Prabin Poudel 12 min read
cover: Beginner's Guide to RuboCop in Rails
RuboCop is a static code analyzer which analyzes the code based on the best practices followed by the Ruby developers around the world and defined on the community Ruby style guide. In this article, we will learn: What is RuboCop? Why use RuboCop? and installing RuboCop in Rails.

Search Engine with Rails

Published by Prabin Poudel 14 min read
cover: Search Engine with Rails
Yes! You can create a full functioning search engine with Rails. In this tutorial you will be learning how to create a search engine with Rails by using elasticsearch. You will learn to configure elasticsearch in the rails app, create search view to search and show results and bonus feature of highlighting matched texts like Google does in it's search results.

Live Stream Logs to Browser with Rails

Published by Prabin Poudel 11 min read
cover: Live Stream Logs to Browser with Rails
Live streaming files content to browser in Rails can be accomplished with the use of Server Side Events. In this tutorial, we will be learning to live stream content inside log files to the browser from Rails controller by using file watcher and server side events.

Setup Factory Bot in Rails

Published by Prabin Poudel 2 min read
cover: Setup Factory Bot in Rails
Factory Bot is a ruby library for setting up test data objects in Ruby. Today we will be setting up Factory Bot in Rails which uses RSpec for testing. Factory Bot helps developers to write less code while testing with the factory objects that is created for each model.

Integrate Pronto with Gitlab CI for Rails App

Published by Prabin Poudel 6 min read
cover: Integrate Pronto with Gitlab CI for Rails App
There are multiple ways to fix missing top level class documentation comment in Rubocop. You can disable it in your whole app with by disabling cop in the whole project, disable it in one class or just add a comment above the class declaration.

Rubocop Configuration Files for Rails

Published by Prabin Poudel 5 min read
cover: Rubocop Configuration Files for Rails
Rubocop is a linter for Rails. Rubocop helps in enforcing best practices for Ruby and Rails. It helps in maintaining consistency throughout the project. It also has option for autoformatting the code based on the configurations.

Build Twitter Bot with Ruby

Published by Prabin Poudel 11 min read
cover: Build Twitter Bot with Ruby
Did you know? We can also build bot with Ruby. Today we will be building twitter bot that retweets set of hashtags. We will be using twitter gem which uses Twitter API under the hood.

Setup Gatsby with Strapi in M1 Mac

Published by Prabin Poudel 16 min read
cover: Setup Gatsby with Strapi in M1 Mac
Setting up strapi with gatsby is straight forward but not while you are setting it up in mac with M1 chip. M1 chip throws so many errors due to software support issues and I am writing this article to save your day.

Interact with Mysql Server using mysql2 gem [Part 4] - Perform Transactions

Published by Prabin Poudel 13 min read
cover: Interact with Mysql Server using mysql2 gem [Part 4] - Perform Transactions
In this part, we will learn about how we can perform transactions in the external mysql database using mysql2 gem. Transactions helps us in making multiple queries to database ensuring all queries are performed or none at all.