Skip to content

Instantly share code, notes, and snippets.

View droidjahangir's full-sized avatar

jahangir alam droidjahangir

  • Dhaka,Bangladesh
View GitHub Profile
@besLisbeth
besLisbeth / heaps.js
Last active August 17, 2022 02:22
MinHeap, MaxHeap, and MedianHeap data structures
// This code was taken from the "JavaScript Data Structures and Algorithms" by Sammie Bae
// from the repository https://github.com/Apress/js-data-structures-and-algorithms,
// refactored to classes, and fixed the problem of adding '0' as the node value
// (it's not working correctly in the origin repository)
class Heap {
items = [];
constructor(values){
@Prottoy2938
Prottoy2938 / Dijkstra's-algorithm.js
Created March 18, 2020 10:02
Dijkstra's algorithm implementation in JavaScript
//Dijkstra algorithm is used to find the shortest distance between two nodes inside a valid weighted graph. Often used in Google Maps, Network Router etc.
//helper class for PriorityQueue
class Node {
constructor(val, priority) {
this.val = val;
this.priority = priority;
}
}
@berkorbay
berkorbay / github_desktop_ubuntu.md
Last active April 30, 2024 14:54
To install Github Desktop for Ubuntu

IMPORTANT

See the following links for further updates to Github Desktop for Ubuntu. These are official instructions. (also mentioned by fetwar on Nov 3, 2023)

For the sake of "maintaining the tradition" here is the updated version.

@justintv
justintv / .bashrc
Created August 17, 2009 00:53
Display git branch in bash prompt
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"