Skip to content

Instantly share code, notes, and snippets.

View rohit267's full-sized avatar
🎯
Focusing

Rohit Mahto rohit267

🎯
Focusing
View GitHub Profile
@rohit267
rohit267 / .bashrc
Created April 12, 2023 18:06
Use multiple github accounts with ssh keys using bash script
# Add these lines to your .bashrc or .zshrc
function checkIfWorkDir(){
if [[ $PWD == *"rohitmahto/work"* ]]; then
echo "Work flder found."
git config user.name rohit-work
git config user.email rohit.mahto@work.com
echo "Git user name and email set to work account."
else
echo "Using Global Git Config."
fi
@rohit267
rohit267 / Azure-logger.js
Created January 31, 2022 07:24
Winston logger with custom Azure File/Blob Storage
import winston from 'winston';
import { AzureBlobTransport } from 'winston-azure-transport';
import moment from 'moment-timezone';
const { combine, printf, colorize } = winston.format;
/**
*
* RSGI-LOGGER WITH AZURE FILE STORAGE TRANSPORT
* Will store logs in journey wise and date wise.
*
@rohit267
rohit267 / Logger.js
Last active December 28, 2021 05:41
Easy Nodejs custom logger with saveToFile support
import chalk from 'chalk';
import moment from 'moment';
import fs from 'fs-extra';
import path from 'path';
/*
* Easy custom logger to save logs in date wise file in DD-MM-YYYY.txt.
* dependencies: chalk, moment, fs-extra
* Author: Rohit Mahto
* Github: https://github.com/rohit267