Note: this only applies to MacOS
Often times while I'm working on a project, I'll need to search for something on the internet to solve a problem. I usually use the search engine created by Google, called Google. When I need to search for something, I always have to stop what I'm doing, and switch over to a browser to type in my search. This may not seem like a big deal because it doesn't take that much time, but in reality this is a context switch. There is a momentary discontinuity in the intentions of your search.
I'd like to remove this obstacle and be able to search without leaving my development environment. This can be accomplished by using the
Place this script in your PATH with the name "search":
~/scripts/search #!/bin/sh open "https://google.com/search?q=$*" # Now you can enter a search query like this: search please help google
A browser tab will then come into focus, showing the results for a Google search of "please help google". Now that's good DX.
Single Responsibility Principle (or SRP) is one of the most important concepts in software development. The main idea of this concept is: all pieces of software must have only a single responsibility.