Skip to content

Instantly share code, notes, and snippets.

View nirajgiriXD's full-sized avatar
🚀
Ready for anything

Niraj Giri nirajgiriXD

🚀
Ready for anything
View GitHub Profile
@nirajgiriXD
nirajgiriXD / node-commands.md
Last active June 6, 2024 12:07
Useful NPM commands

NPM:

npm -v
npm audit
npm audit fix
npm cache clean
npm init -y	
npm i
npm i -g <package-name>	
npm i -D <package-name>	
import json
import re
from googletrans import Translator
from bs4 import BeautifulSoup
# Function to translate text while preserving placeholders
def translate_text_with_placeholders(text, target_language):
# Define placeholder pattern
placeholder_pattern = re.compile(r'\$([^\$]+)\$', flags=re.IGNORECASE)
@nirajgiriXD
nirajgiriXD / GitHub Workflow and Development Process.md
Last active March 18, 2024 10:57
This gist outlines a comprehensive GitHub workflow and development process for managing projects collaboratively using Git and GitHub.

GitHub Workflow and Development Process

  • The main branch should be kept stable for potential releases.
  • Create a develop branch for ongoing development and set it as the default branch.
  • For adding a feature, create a branch starting with feat/ (e.g., feat/feature-name) from the develop branch.
  • For fixing an issue, create a branch starting with fix/ (e.g., fix/feature-name, fix/issue-name) from the develop branch.
  • For refactoring code, create a branch starting with ref/ (e.g., ref/feature-name, ref/v1.0.0) from the develop branch.
  • For release, create a branch starting with release/ (e.g., release/v1.0.0) from the develop branch.
  • Once the release branch is ready, merge it to the main branch.
@nirajgiriXD
nirajgiriXD / wordpress-commands.md
Last active April 25, 2024 13:14
Useful WordPress commands

WP CLI

wp i18n make-pot . ./destination/path/file_name.pot --exclude=<dir>
wp i18n update-po ./source/path/file_name.pot ./destination/path/file_name.po
wp i18n make-mo ./source/path/file_name.po

WP Blocks

Useful Extensions for Visual Studio Code

  • Auto Import
  • Auto Rename Tag
  • Awesome Flutter Snippets
  • Babel JavaScript
  • Code Runner
  • Code Spell Checker
  • Dart
  • Data Preview
@nirajgiriXD
nirajgiriXD / git-commands.md
Last active June 19, 2024 06:23
Useful Git commands

Git Commands

git add .
git branch <branch-name>
git branch -a
git branch -m <old-branch-name> <new-branch-name>
git checkout <branch-name>
git checkout <commit-hash> -- <file/to/restore>
git checkout -b <branch-name>
@nirajgiriXD
nirajgiriXD / useful-commands.md
Last active May 3, 2024 12:58
Useful Commands

Useful Commands

Bash:

history
!historyId
whoami
brew update
brew update <package-name>
rm -rf .*