Posts

Showing posts from March, 2023

Use ChatGPT for improve your coding quality

Image
Hi, This is  Shubham Mishra  from India,   In this post we will discuss about how to Use ChatGPT for improve your coding quality and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... When first time i asked ChatGpt to write some script for me, I asked "Write a shell script to open multiple chrome windows with some url's", it was to my surprise that ChatGPT not only wrote the script it also tried to explain every line of code, you can check the script here : Shell script to open multiple chrome windows , so then onwards not only for writing script but also for reviewing some of my work related code I ask ChatGPT to review and rewrite me optimised code too. How can Chat GPT provide some general tips and best practices that developers can follow to write good code: 1. Follow coding standards and best practices: Consistency is key when it comes to writing good code. Follow established coding standards and bes

Amazon Interview question from leetcode coding problem 1

Hi, This is  Shubham Mishra  from India,  this is the part of  Ruby on Rails  exploration journey.  In this post we will discuss about the leetcode problem and its both worst and best case solution asked in Amazon interview process and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... Problem Statement: Return the indices of the two numbers such that they add up to target given an array of integers nums and an integer target. You may presume that each input would have exactly one solution, and you may not use the same element twice. The input array nums can be assumed to not be sorted, but you are free to return the solution in any order. Example: Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: nums[0] + nums[1] = 2 + 7 = 9, so [0, 1] is the correct answer. Here is the function signature in Python to help you get started: The problem is to find two indices in an array of integers nums whose cor

Shell script to open multiple chrome windows with auto close command

Hi, This is  Shubham Mishra  from India,  this is the part of  Ruby on Rails  exploration journey.  In this post we will discuss about the shell script code to open multiple chrome windows and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... In this blog we will going to write a shell script to open N number of url's in a new Chrome incognito windows. Some times we want to test load on our websites or want to increase the view count of our youtube videos then we need some automations, here the actual requst is : "Write a shell script for opening new incognito window of chrome from list of urls in random manner, and also keep random sleep time between 1 minute to 10 minute for next iteration and also close the opened window after 3 minutes" This is how the script functions: 1. Set the URL list to open. 2. cycle over each URL. 3. Set a random sleep period of between one and ten minutes. 4. Use the goog