Skip to main content

Posts

Showing posts from July, 2023

The ultimate tool for finding and replacing patterns in files

Are you looking for a simple and powerful tool that can help you find and replace patterns in files? If so, you might want to check out  FindReplace , a command line tool that allows you to search and replace text or data structures in any file using JSON, YAML,  CSON , or plain text formats. FindReplace  is a Rust-based tool that is easy to install and use. You can download it from  crates.io  or  GitHub , or build it from source using Cargo. Once installed, you can use it by running the command findreplace followed by the pattern, the substitute, and the file path. For example, if you want to replace all occurrences of “foo” with “bar” in a file named file.txt, you can run the command: findreplace 'foo' 'bar' file.txt FindReplace also supports using JSON, YAML, or CSON files as substitutes. This means you can use these formats to define complex data structures that can be used to replace multiple patterns at once. For example, if you have a file named file.txt t

The smart way to clone GitHub sub-directories!

Do you want to clone a sub-directory of a GitHub repository without downloading the whole repo? Do you want to save time and bandwidth by cloning only the part of the repo that you need? If yes, then you need  clone-github-subdir , a handy command-line tool that lets you do just that! clone-github-subdir  is a simple and fast way to clone any sub-directory of a GitHub repo to your local machine. It is useful for many scenarios, such as: You want to try out a sample project or a tutorial from a large repo, but you don’t want to clone the entire repo. You want to reuse some code or files from a sub-directory of another repo, but you don’t want to fork or clone the whole repo. You want to contribute to a sub-directory of an open-source repo, but you don’t want to clone the whole repo and deal with unnecessary files. With  clone-github-subdir , you can clone any sub-directory of a GitHub repo with just one command. You can also choose to clone only the current sub-directory

How to setup WASI SDK on Linux?

Setting up the  WASI SDK  is the simplest on Linux like Ubuntu. You just need to run few lines of commands. That's it! Open the Linux terminal and go to a directory where you can download the payload. Usually, I prefer downloading the stuffs in /home directory but it's up to you. Run these commands to download and install the WASI SDK curl -O -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk_20.0_amd64.deb sudo dpkg -i wasi-sdk_20.0_amd64.deb export PATH=/opt/wasi-sdk/bin:$PATH export CC=/opt/wasi-sdk/bin/clang export CXX=/opt/wasi-sdk/bin/clang++ Now you are ready to use WASI SDK which you can check by this command, clang -v . If it prints the version info then all is well.

Git Flow based branch naming convention

Git flow is a branching model for Git that helps large teams collaborate on projects. There are several best practices for naming Git branches. One of them is to begin with unique IDs like JIRA ID followed by JIRA title in the branch names. You can use hyphen as separators and avoid using numbers only. You can also use Git flow's naming conventions, which are based on the type of branch you're creating. For example, feature branches should be named `feature/branch-name`, release branches should be named `release/version-number`, hotfix branches should be named `hotfix/branch-name`, and bugfix branches should be named `bugfix/branch-name`. So our branch names syntax could be like <work-type>/<jira-id>-<jira-title> for e.g., feature/AIQ-12345-summary-title-of-enhancement-task hotfix/AIQ-12345-summary-title-of-hotfix-task bugfix/AIQ-12345-summary-title-of-bugfix-task release/AIQ-12345-summary-title-of-release-task If you make the branches from jira website then t