Skip to content

Instantly share code, notes, and snippets.

View Sunny-unik's full-sized avatar
🏠
Just ask

Sunny Gandhwani Sunny-unik

🏠
Just ask
View GitHub Profile
[
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
@Sunny-unik
Sunny-unik / dockerCli.bash
Last active December 12, 2023 16:03
Docker basic commands
docker run -it <image-name> # for run new image (if not present locally then docker install it from 'hub.docker.com')
docker run -it -p system-port:docker-port <service-name> # port mapping
docker run -it -p system-port:docker-port -e key='value' -e key='value' <service-name> # port mapping with setting env
docker exec <container-name> <command> # for execute a command inside specified container
docker pull <image-name> # for pull docker image using image-names
@Sunny-unik
Sunny-unik / GitCommands.txt
Last active October 21, 2023 15:38
Git commands basics to advance
Basic Commands:
git clone [url]
- clone repository
git log
- show recent commits and tell where head & origin are stands in present branch
git status
- check your working tree changes
git fetch --all
- update branch info on local
@Sunny-unik
Sunny-unik / NpmCommands.txt
Last active September 18, 2023 17:33
Some useful commands of npm
npm --version
- tells the node-package-manager version (shorthand use '-v' instead of 'version')
npm init
- initialize package.json
npm install
- install all node packages that are written as dependencies in packages.json (shorthand use 'i' instead of 'install')
npm install <package-name> <package-name>
- install specified packages (-D and --save-dev for install as dev-dependencies) (-g for install globally)
npm uninstall <package-name>
- uninstall packages
@Sunny-unik
Sunny-unik / bashrc.sh
Last active September 18, 2023 17:17
Bash utility functions & aliases
# self made functions
killPortFunction() {
if [ -z "$1" ]; then
echo "Usage: killPort <port>"
return 1
fi
echo "Killing process on port $1"
sudo kill -9 $(sudo lsof -t -i:$1)
}
@Sunny-unik
Sunny-unik / Mailer.js
Created September 3, 2023 11:59
Send mail via gmail SMTP server using nodemailer.
import nodemailer from 'nodemailer';
export default function (from, appPassword, to, subject, htmlMsg) {
return new Promise((resolve, reject) => {
const mailOptions = {
from: from,
to: to,
subject: subject,
html: htmlMsg,
};