Skip to content

Instantly share code, notes, and snippets.

@dipenparmar12
dipenparmar12 / work-with-multiple-github-accounts.md
Created June 9, 2023 05:01 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@dipenparmar12
dipenparmar12 / .eslintrc.js
Created January 7, 2023 10:56 — forked from onlime/.eslintrc.js
ESLint/Prettier config for Vue 3 in VS Code
module.exports = {
root: true,
env: {
browser: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'prettier'
@dipenparmar12
dipenparmar12 / unzip.php
Created March 29, 2022 08:04
PHP Script to Extract Zip file
<?php
try {
$input_zip = $_GET["filename"];
$target_dir = $_GET["target_dir"] ?? "./";
echo "Starting...";
if (!is_file($input_zip) || !is_readable($target_dir)) {
die("Can't Read Input");
}
@dipenparmar12
dipenparmar12 / jsTypeValidate.js
Last active October 24, 2022 09:18
JavaScript type check
/*
* Type check
* */
const Assertion = {
isFunction(x) {
return Object.prototype.toString.call(x) === '[object Function]'
},
isString(x) {
return Object.prototype.toString.call(x) === '[object String]'
},

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

#!/usr/bin/env bash
#
# Script to create virtual host for Nginx server
#
# @author Raj KB <magepsycho@gmail.com>
# @website http://www.magepsycho.com
# @version 1.2.0
# UnComment it if bash is lower than 4.x version

Path subl /etc/nginx/sites-available/default

Restart sudo systemctl reload nginx && sudo nginx -s reload && sudo nginx -t

URL http://localhost/dev/

const winston = require('winston');
const { format } = require('winston');
const appRoot = require('app-root-path');
const config = require('./config');
const printf = (info) => {
if (typeof info.message === 'object') {
// eslint-disable-next-line no-param-reassign
info.message = JSON.stringify(info.message, null, 3);
}
@dipenparmar12
dipenparmar12 / git_log.php
Created October 9, 2020 10:28
Generate git log ( author, date, msg and commit hash) array
<?php
// Last 20 commits
$number_of_log = 20
// Change To Repo Directory
chdir("/full/path/to/repo");
// Load Last 10 Git Logs
$git_history = [];
$git_logs = [];
@dipenparmar12
dipenparmar12 / Mailhog_installation.md
Last active January 19, 2024 14:27
Mailhog installation guide (Linux)

Mailhog

Video Tutorial

1. Install GoLang

Install

Mailhog Requires Go 1.4+ to run so we will install GO language in system.