Skip to content

Instantly share code, notes, and snippets.

View mukuljainx's full-sized avatar
👨‍💻
👓

Mukul Jain mukuljainx

👨‍💻
👓
View GitHub Profile
@mukuljainx
mukuljainx / vscode-mac-windows-keybinding.json
Last active July 11, 2022 17:58
Windows VSCode keybinding to replicate Mac
[
{
"key": "alt+1",
"command": "workbench.action.focusFirstEditorGroup"
},
{
"key": "ctrl+1",
"command": "workbench.action.openEditorAtIndex1"
},
@mukuljainx
mukuljainx / object-diff.ts
Created December 5, 2020 13:52
Returns the partial deep diff between two objects
type PartialDeep<T> = {
[P in keyof T]?: PartialDeep<T[P]>;
};
type objectType = Record<string, any>;
type nonObjectType = number | string | undefined | boolean | null;
const arrayDiff = <T extends nonObjectType | objectType>(
oldArr: T[],
newArr: T[],
@mukuljainx
mukuljainx / .bashrc
Last active December 13, 2019 07:02
Bash command to fetch Pull Request with PR ID ( Only works with Github )
## Append this to bashrc file or zshrc file
fetch-pr(){
if [ "$1" = "" ]
then
echo 'Plese Provide PR number as agrument.'
echo 'For example, fetch-pr 47'
else
git fetch origin pull/$1/head:pr-$1 && git checkout pr-$1
fi
@mukuljainx
mukuljainx / Default (Linux).sublime-keymap
Created February 9, 2018 06:41
Sublime Editor Key for replicating partial behaviour of OS X (This is after switching keys Left Alt as Ctrl, Ctrl as Super, Win as Alt)
[
{ "keys": ["ctrl+right"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["ctrl+left"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+shift+left"], "command": "move_to", "args": {"to": "bol", "extend": true} },
{ "keys": ["ctrl+shift+right"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["ctrl+up"], "command": "swap_line_up" },
{ "keys": ["ctrl+down"], "command": "swap_line_down" },
]
@mukuljainx
mukuljainx / keymap.cson
Last active January 27, 2018 17:18
Atom Editor Key for replicating partial behaviour of OS X (This is after switching keys Left Alt as Ctrl, Ctrl as Super, Win as Alt)
'body':
'ctrl-1': 'pane:show-item-1'
'ctrl-2': 'pane:show-item-2'
'ctrl-3': 'pane:show-item-3'
'ctrl-4': 'pane:show-item-4'
'ctrl-5': 'pane:show-item-5'
'ctrl-6': 'pane:show-item-6'
'ctrl-7': 'pane:show-item-7'
'ctrl-8': 'pane:show-item-8'
'ctrl-9': 'pane:show-item-9'
@mukuljainx
mukuljainx / allocateCourse.py
Last active November 2, 2017 06:48
A program to allocate courses to student as per their preferences and availability.
#This will left many unallocated student as there is no upper cap defiend for cce student on CSE and ECE courses.
import numpy as np
studentPreferenceFile = open("generated.csv", "r")
#creating objects of student choice
studentPreferenceFileData = studentPreferenceFile.readlines()
@mukuljainx
mukuljainx / infixtoprefix.cpp
Created August 15, 2015 11:43
A program thats converts Infix to prefix and then calculates result using prefix equation only in a proper way.
/**************************************************************
Author : Mukul Jain
Date : 15 Aug 2015
Note : There are lot of cout which I created to
help me to write this program you can
erase them or covert to comment
according to convience.