This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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\] $ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = [email protected] | |
name = Zeeshan Ahmad | |
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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. | |
*/ |