Skip to content

Instantly share code, notes, and snippets.

View zeeshan1112's full-sized avatar
💭
For you to do something new, you need to stop doing something old.

Zeeshan Ahmad zeeshan1112

💭
For you to do something new, you need to stop doing something old.
View GitHub Profile
@zeeshan1112
zeeshan1112 / maxHeap.js
Last active September 4, 2023 14:14
Implementation of Max Heap data structure in Javascript
//Implement a max heap in Javascript
/**
* - Implement the constructor
* - Implement the insert() function
* - Implement the getMax() function
* - Implement the removeMax() function
* - Implement the __maxHeapify() function
* - Implement the __bubbleUp() function
* The two underscores before the __bubbleUp() and __maxHeapify() functions imply that these functions should be treated as private functions.
*/
@zeeshan1112
zeeshan1112 / .gitconfig
Created December 29, 2019 09:49
Sample .gitconfig file with color information
[user]
email = zeeshan.ahmad@sap.com
name = Zeeshan Ahmad
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
@zeeshan1112
zeeshan1112 / .bash_profile
Created December 29, 2019 09:41
Code snippet to add branch information on your mac terminal
# Git branch in prompt.
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ "
@zeeshan1112
zeeshan1112 / QuickSort.js
Created March 19, 2019 15:09
#Quick sort in javascript
function Array(arr){
this.arr = arr;
};
Array.prototype.doQuickSort = function(low, high) {
if(low < high) {
var pi = this.partition(low, high);
this.doQuickSort(low, pi-1);
this.doQuickSort(pi+1, high);
}
return this.arr;
@zeeshan1112
zeeshan1112 / ConvertStringsToUnicode.js
Last active March 19, 2019 15:12
#Add Unicode value of strings in JSON array #ConvertStringsToUnicode #ConvertUnicodeToStrings
/**
* This file takes a Javascript Object array of iso Languages as input
* and appends unicode to the array.
* input array : [{"code":"af","nativeName":"Afrikaans"}]
* Output array : [{"code":"af","nativeName":"Afrikaans"}, "unicodeName": "\\u0041\\u0066\\u0072\\u0069\\u006B\\u0061\\u0061\\u006E\\u0073"]
*/
function StringManipulation() {
this.languageCode = [{
"code": "zz",